判断奇偶数

       //流行的"程序员"
        public static bool IsOdd(int n)
        {
            while (true)
            {
                switch (n)
                {
                    case 1: return true;
                    case 0: return false;
                }
                n -= 2;
            }
        }

        // 中规中矩的程序员 
        public static bool IsOdd(int n)
        {
            return (n % 2 == 1) ? true : false;
        }

        // 有经验的C#程序员 
        public static bool IsOdd(int n)
        {
            return Convert.ToBoolean(n % 2);
        }

        // 汇编程序员 
        public static bool IsOdd(int n)
        {
            return Convert.ToBoolean(n & 1);
        }
原文地址:https://www.cnblogs.com/xienb/p/10308122.html