第1个回答 2015-09-17
static void Main(string[] args)
{
List<int> testMath=new List<int>();
for (int i = 0; i < 10; i++)
{
int t = Convert.ToInt32(Console.ReadLine());
testMath.Add(t);
}
testMath.Sort();
foreach (int i in testMath)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
简单写了一下,未对输入值进行判断,输入非数字会报错,可以自己加下验证本回答被网友采纳