标签:ar for sp c new r bs 字符串 print
public static void main(String[] args) {
String str = "1,2,3;4,5;6,7,8,9";
String[] s1 = str.split(";");
double [][]d;
d = new double[s1.length][];
for (int i = 0; i < s1.length; i++) {
String[]s2 = s1[i].split(",");
d[i] = new double[s2.length];
for (int j = 0; j < s2.length; j++) {
d[i][j] = Double.parseDouble(s2[j]);
}
}
for (int i = 0; i < d.length; i++) {
System.out.println();
for (int j = 0; j < d[i].length; j++) {
System.out.print(" "+d[i][j]);
}
}
}
标签:ar for sp c new r bs 字符串 print
原文地址:http://www.cnblogs.com/oraclespace/p/3983390.html