1.按行读取数字,可以使用字符串存储,再进行类型转换
String s [] = sc.nextLine().split(" ");
int x = Integer.parseInt(s[]);
2.Arrays.sort(a)
对int型数组排序,从小到大
对string型数组排序,从a到z
3.注意数据范围,int->long
1.按行读取数字,可以使用字符串存储,再进行类型转换
String s [] = sc.nextLine().split(" ");
int x = Integer.parseInt(s[]);
2.Arrays.sort(a)
对int型数组排序,从小到大
对string型数组排序,从a到z
3.注意数据范围,int->long