using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
int[] CountArray = new int[20];
int odd = 0;
int even = 0;
for (int i = 0; i < CountArray.Length; i++)
{
Console.WriteLine("Input [{0}] number :", i + 1);
CountArray[i] = Convert.ToInt32(Console.ReadLine());
}
for (int i = 0; i < CountArray.Length; i++)
{
if (CountArray[i] % 2 == 0)
even++;
if (CountArray[i] % 2 != 0)
odd++;
}
Console.WriteLine("Odd count: {0}", odd);
Console.WriteLine("Even count: {0}", even);
Console.ReadKey();
}
}
}
Comments
Leave a comment