arraylist用法,怎么无法显示排序???
using System;using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace array
{
class Program
{
static void Main(string[] args)
{
int i;
Random rd = new Random(DateTime .Now .Second );
ArrayList alist = new ArrayList();
for (i = 0; i < 20; i++)
{
alist.Add(rd.Next (60,100));
if (i % 10 == 0)
{
alist.Add('\n');
}
}
foreach (object ob in alist)
{
Console.Write("{0,4}",ob );
}
alist.Sort();
for (int j = 0; j < alist.Count; j++)
{
alist .Add (alist[j ]);
}
foreach (object obj in alist)
{
Console.Write("{0,4}", obj);
}
Console.Read();
}
}
}