求助~!
我想作个程序,从控制台读取一些数据,然后从小到大排列一下
using System; class PaiXu {
static void Main() { string[] Aa=new string[100] ; int n=1; int i=1; string temp; Console.WriteLine("Please enter some words:"); Aa[n] = Console.ReadLine(); while( Aa[n] !="q") { n++; Aa[n] = Console.ReadLine(); //Console.WriteLine(Aa); } for(i=1;i<n-1;i++) { for (int ii = 1; ii <n-i; ii++) { if(Int32.Parse(Aa[ii]) >Int32.Parse(Aa[ii+1])) { temp=Aa[ii]; Aa[ii]=Aa[ii+1]; Aa[ii+1]=temp; } } } for (i=1; i<n; i++) { Console.WriteLine("{0}",Aa[i]); } Console.ReadLine(); } }
输入N个数当遇到“q“时输出结果