變網際網路了

Monday, December 25, 2006

12/25 Lab Sorting


public class aaa
{
public static void main(String[] args)
{
double[] score={80.0, 99.9, 75, 100, 85.5};
double m ;
for
(int x = 0; x < score.length-1; x++)
{
for(int y = x+1; y < score.length; y++)
{
if( score[y]
{
m=score[y];score[y]=score[x];score[x] = m;
}
}
}
for(int x = 0; x < score.length; x++)
{
System.out.println(score[x]);
}
}

0 Comments:

Post a Comment

<< Home