日期:2014-05-20 浏览次数:20738 次
BufferedReader reader = new BufferedReader(new FileReader("E:/test.txt"));
int[][] a = new int[2][5];
String line = null;
while ((line = reader.readLine()) != null) {
String[] vStrs = line.split(",");
for (int i = 0; i < vStrs.length; i++) {
if (i < 5) {
a[0][i] = Integer.parseInt(vStrs[i]);
} else {
a[1][i - 5] = Integer.parseInt(vStrs[i]);
}
}
}