(记录c#的学习)
c#中接收一串整数
using System;
using System.Collections;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Exp
{
class Program
{
static void Main(string[] args)
{
string a;
string[] str;
ArrayList arr1 = new ArrayList();
ArrayList arr2 = new ArrayList();
Console.Write("输入若干整数:");
a = Console.ReadLine();
str = a.Split(' ');
for (int i = 0; i < str.Length; i++)
{
if(int.Parse(str[i])%2 == 0)
{
arr2.Add(str[i]);
}
else
{
arr1.Add(str[i]);
}
}
Console.WriteLine("奇数个数:{0},偶数个数{1}",arr1.Count,arr2.Count);
Console.Write("所有奇数");
foreach(string b in arr1)