完成以下要求:
int[] shuru = new int[6];
int max = 0;
try
{
for (int i = 0; i < shuru.Length; i++)
{
Console.WriteLine("请输入第{0}个整数",i+1);
shuru[i] = Convert.ToInt32(Console.ReadLine());
}
for (int i = 0; i < shuru.Length-1; i++)
{
for (int j = 0; j < shuru.Length-1-i; j++)
{
if (shuru[j]>shuru[j+1])
{
max = shuru[j];
shuru[j] = shuru[j+1];
shuru[j+1] = max;
}
}
}
for (int i = 0; i < shuru.Length; i++)
{
Console.Write("{0}\t",shuru[i]);
}
}
catch
{
Console.WriteLine("输入有误请重新输入");
}
Console.ReadKey();