using System;
class ordernum
{
static void Main()
{
Console.WriteLine("How many number you want to put !");
int a =int.Parse(Console.ReadLine());
int[] c=new int[a];
for (int b=0;b<a;b++)
{
Console.WriteLine("Input a number!");
c[b]=int.Parse(Console.ReadLine());
}
for(int i=1;i<a;i++)
{
for (int ii =0; ii <a-i; ii++)
{
if(c[ii] <c[ii+1])
{
int temp;
temp=c[ii];
c[ii]=c[ii+1];
c[ii+1]=temp;
}
}
}
for (int i=0; i<a; i++)
{
Console.Write("{0}"+" ",c[i]);
}
Console.WriteLine();
}
}
刚试了下。可以
我是初学者,希望大家能多多帮助我
/bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif" border="0" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://bbs./bbs/showimg.asp?BoardID=34&filename=2005-4/200542294030151.gif');}" onmousewheel="return imgzoom(this);" alt="" />