67,537
社区成员
发帖
与我相关
我的任务
分享 public static void main(String[] args)
{
// TODO Auto-generated method stub
int[] score = new int[5];
Scanner input = new Scanner(System.in);
System.out.println("请输入成绩");
for (int i = 0; i < 5; i++)
{
score[i] = input.nextInt();
}
Arrays.sort(score);
System.out.println("学员成绩按升序排列");
for (int index = 0; index < score.length; index++)
{
System.out.println(score[index]);
}
System.out.println("学员成绩按jiang序排列");
for (int index =score.length-1 ; index >=0; index--)
{
System.out.println(score[index]);
}
}