public class Bubble {
public static void main(String[] args) {
// TODO Auto-generated method stub
int score[]={67,89,87,69,90,100,75,90};
for(int i=0;i<score.length-1;i++)
for(int j=i+1;j<score.length;j++){
if(score[j]<score[i]){
int temp=score[i];
score[i]=score[j];
score[j]=temp;
}
}
for(int i:score)
System.out.println(i);
}
}
冒泡排序java实现
最新推荐文章于 2024-08-15 06:00:00 发布