示例#1
0
文件: Program.cs 项目: oindreela/MMS
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            int[] a    = new int[n];
            int   flag = 1;

            for (int i = 0; i < n; i++)
            {
                a[i] = int.Parse(Console.ReadLine());
                if (a[i] < 0)
                {
                    flag = 0;
                }
            }
            int x = UserProgramCode.countOddInteger(a);

            if (flag == 0)
            {
                Console.WriteLine("The Array consists non-positive value(s)");
            }
            else
            {
                Console.WriteLine(x);
            }
        }
示例#2
0
文件: Program.cs 项目: oindreela/MMS
        static void Main(string[] args)
        {
            string str = Console.ReadLine();
            bool   b   = UserProgramCode.validateNumber(str);

            if (b == true)
            {
                Console.WriteLine("Valid Number");
            }
            else
            {
                Console.WriteLine("Invalid Number");
            }
        }