···
public static void main(String[] args) {
int [] list = new int[6];
list[0]=99;
list[1]=85;
list[2]=82;
list[3]=63;
list[4]=60;
// list[5]=0;
// Arrays.sort(list,0,4);
// System.out.println(Arrays.toString(list));
System.out.println("请输入你要插入的成绩");
Scanner scanner = new Scanner(System.in);
int value = scanner.nextInt();
int index = list.length;
for (int i = 0 ; i<list.length ; i++){
if(value > list[i]){
index = i;
break;
}
}
for(int i =list.length -1 ; i>index ; i --){
list[i]=list[i-1];
}
list[index] = value;
for (int i = list.length-1 ; i >=0 ; i--){
System.out.println(list[i]+"\t");
}
}
···