Java代码
package test;
public class test {
public static void main(String args[]){
char ch1 = 'a';
System.out.println("ch1 = " + ch1);
int score[] = {1, 3, 5, 2, 4, 7};
for(int i = score.length; i > 0; i--){
for(int j = 0; j < i - 1; j++){
if(score[j] > score[j+1]){
int temp = score[j];
score[j] = score[j+1];
score[j+1] = temp;
}
}
}
for(int i = 0; i < score.length; i++){
System.out.println(score[i]);
}
}
}
冒泡排序