package com.yun.java.six;
import java.util.Scanner;
public class P5 {
public static void main(String[] args) {
System.
out.println(
"请输入十个数字:");
Scanner input=
new Scanner(System.
in);
int[] scores=
new int[
10];
for (
int i =
0; i <scores.length; i++) {
System.
out.println(
"请输入第"+(i+
1)+
"个人的成绩");
scores[i]=input.nextInt();
}
System.
out.println(
"排序后的成绩为:");
for (
int i =
0; i < scores.length-
1; i++) {
for (
int j =
0; j < scores.length-
1-i; j++) {
if (scores[j]>scores[j+
1]) {
int num=scores[j];
scores[j]=scores[j+
1];
scores[j+
1]=num;
}
}
}
for (
int i =
0; i < scores.length; i++) {
System.
out.print(scores[i]+
" ");
}
}
}