StringBuffer sb = new StringBuffer(200); for (int i = 1, j = 1; j <= 9; i++) { sb.append(j+"*"+i+"="+i*j+" "); if (i == j) { i = 0; j++; sb.append("\n "); } } System.out.println(sb);
本文共 330 字,大约阅读时间需要 1 分钟。
StringBuffer sb = new StringBuffer(200); for (int i = 1, j = 1; j <= 9; i++) { sb.append(j+"*"+i+"="+i*j+" "); if (i == j) { i = 0; j++; sb.append("\n "); } } System.out.println(sb);
转载于:https://www.cnblogs.com/lxh520/p/8275668.html