展开全部
public class Test {
private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static int getInt(){
32313133353236313431303231363533e59b9ee7ad9431333335333638return Integer.parseInt(getString());
}
public static String getString(){
try {
return br.readLine();
} catch (IOException e) {
return "";
}
}
public static void main(String[] args) throws IOException {
int[] s = new int[5];
for(int i=0; i
System.out.print("请输入第 " + (i+1) + " 个数: ");
s[i] = getInt();
}
System.out.println("排序前: " + Arrays.toString(s));
Arrays.sort(s);
System.out.println("排序后: " + Arrays.toString(s));
}
}