📌  相关文章
📜  c#检查数字是奇数还是偶数 - C#代码示例

📅  最后修改于: 2022-03-11 14:49:19.434000             🧑  作者: Mango

代码示例2
static int counter = 0;
    public int maxstrairs = 100;
    
    void Start()
    {
        counter++;
        if(counter < maxstrairs)
        {
            dothestairs();
        }

    }

    private void dothestairs()
    {
        if (counter % 2 == 0)
        {
            // even
        }
        else
        {
           // odd
        }
    }