public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String[] s = sc.nextLine().split("\\s+"); //一空格的方式输入
String[] s = sc.nextLine().split(","); //一逗号的方式输入
//。。。下面开始处理字符数组
//例如 把数组转换为整数
ArrayList<Integer> mm = new ArrayList<Integer>();
for(String i :s){
mm.add(Integer.parseInt(i));
}
}
}
Java的Scanner
最新推荐文章于 2023-07-28 10:35:33 发布