#编码
try
{
Console.WriteLine("输入数字");
int yi = 0;
int er = 0;
int san = 0;
int cuowu = 0;
int[] num = new int[10];
for (int i = 0; i < num.Length; i++)
{
Console.Write("第{0}个数字:", i + 1);
string str_a = Console.ReadLine();
int a = Convert.ToInt32(str_a);
num[i] = a;
if (num[i] == 1)
{
yi += 1;
}
else if (num[i] == 2)
{
er += 1;
}
else if (num[i] == 3)
{
san += 1;
}
else
{
cuowu += 1;
}
}
Console.WriteLine("数字1有:{0}", yi);
Console.WriteLine("数字2有:{0}", er);
Console.WriteLine("数字3有:{0}", san);
Console.WriteLine("错误数字有:{0}", cuowu);
}
catch
{
Console.WriteLine("输入错误");
}
Console.ReadKey();