逻辑判断

    class Program
    {
        static void Main(string[] args)
        {
            bool b = true;
            int i = 0;
            if (b || (++i>0))
            {
            }
            Console.WriteLine("{0}", i);

            b = false;
            i = 0;
            if (b && (++i > 0))
            {
            }
            Console.WriteLine("{0}", i);
            ReTest();
        }

        private static void ReTest()
        {
            bool b = false;
            int i = 0;
            if (b || (++i > 0))
            {
            }
            Console.WriteLine("{0}", i);

            b = true;
            i = 0;
            if (b && (++i > 0))
            {
            }
            Console.WriteLine("{0}", i);
        }
        /*
        0
        0
        1
        1
        请按任意键继续. . .
        */
    }
原文地址:https://www.cnblogs.com/sky20080101/p/6603619.html