using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
try
{
ArrayList mylist = new ArrayList();
mylist.Add(92);
mylist.Add(80);
mylist.Add(88);
mylist.Add(91);
mylist.Add(100);
mylist.Sort();
mylist.Reverse();
Console.WriteLine("请输入新增成绩:");
int number = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("插入成绩的下标:{0}");
Console.WriteLine("插入后成绩信息是:");
mylist.Add(number);
mylist.Sort();
mylist.Reverse();
foreach (var item in mylist)
{
Console.Write(item + "\t");
}
}
catch
{
Console.WriteLine("您输入的程序错误");
}
Console.ReadKey();
}
}
}
网友评论