package com.mall;
import java.util.Scanner;
public class chengjishengxu {
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;
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");
}
}
}