java吧 关注:1,229,190贴子:12,688,093
  • 0回复贴,共1

大佬们求助

只看楼主收藏回复


这个我应该怎么修改
public staticvoidmain(String[] args){
Integer[] numbers = new Integer[5];
int i = 0;
{
System.out.print("请输入第" + (i + 1) + "个数:");
Scanner scanner = newScanner(System.in);
scanner.useDelimiter("\n");
String next = scanner.nextLine();
numbers[i] = Integer.parseInt(next);
i++;
{while (i < 5);
Arrays.sort(numbers);
System.out.print("您输入的5个数字,排序后的结果是:");
for (Integer number : numbers){
System.out.println(number);
}
}
}
}


1楼2022-09-24 22:53回复