代码
.效果图
.代码
try
{
Console.WriteLine("请输入一个数字");
int a = Convert.ToInt32(Console.ReadLine());
int[] shuzhu1 = { 85, 90, 60, 65, 83,a };
ArrayList shuzhu = new ArrayList(shuzhu1);
shuzhu.Sort();
shuzhu.Reverse();
Console.WriteLine("排序之后:");
foreach (var item in shuzhu)
{
Console.Write("{0}\t",item);
}
}
catch
{
Console.WriteLine("出错了啊。");
}
Console.ReadKey();
网友评论