//流行的"程序员"
        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);
        }

 

相关文章:

  • 2021-10-15
  • 2022-02-10
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-11
  • 2022-01-20
  • 2021-05-30
相关资源
相似解决方案