Console.Write("请输入" + NUM + "个数:");
string str = Console.ReadLine();
char[] ch = { ' ' };
//动态数组,用来记录输入的数的个数
ArrayList ar = new ArrayList();
string[] st = str.Split(ch, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < st.Length; i++)
{
ar.Add(st[i]);
}
while (ar.Count < NUM)
{
str = Console.ReadLine();
st = str.Split(ch, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < st.Length; i++)
{
ar.Add(st[i]);
}
}
int[] a = new int[NUM];
for (int i = 0; i < NUM; i++)
{
a[i]