Lab Sorting
package s9226307;public class Sorting
{
public static void main(String args[])
{
double[] number= {4, 3, 6, 7, 5,4.3,8,9.9,11,2};
int x,y;
double z;
for(x=0;x<10;x++) y="0;y<10;y++)">number[y])
{
z=number[x];
number[x]=number[y];
number[y]=z;
}
}
}
for(x=0;x<10;x++)
{
System.out.print(" "+number[x]+" ");
}
System.out.println("");
System.out.println("由大到小");
System.exit(0);
}
}
0 Comments:
Post a Comment
<< Home