public class javaLianxi {
public static void main(String[] args) {
int results[]={1,2,3,4,5,6,7,8,9};
for (int i = 0; i < results.length-1; i++) {
for (int j = i+1; j < results.length; j++) {
if (results[i]<results[j]) {
int temp=results[i];
results[i]=results[j];
results[j]=temp;
}
}
}
for (int i = 0; i < results.length; i++) {
System.out.println(results[i]);
}
}
}
阿旭_
qq_非诚勿扰_3
相关分类