我的档桉是这样的
3 5 7 9
2 4 6 5
我想把第一行的值放入arrayA,第二行的值放入arrayB,这就是我现在所拥有的。
while(sc.hasNextLine()) {
while (sc.hasNextInt()) {
arrA[i] = sc.nextInt();
arrB[i] = Integer.parseInt(sc.nextLine());
i++;
}
}
2条答案
按热度按时间svmlkihl1#
可能是这样的
zz2j4svz2#
文件:abc.txt
三五七九
二四六五
输出:
三五七九
二四六五