public class Beijing2 {
public static void main(String[] args) throws IOException {
for (int i = 0; i < 10; i++) {
for (int j= 1; j < 10; j++) {
System.out.print(j);
}
System.out.println();
}
}
}
以下代码 :如何 输出 123456789
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- threenewbee 2020-08-01 21:41关注
public class Beijing2 { public static void main(String[] args) throws IOException { for (int i = 0; i < 10; i++) { for (int j= 1; j < 10; j++) { if (j == 9 && i != 9) System.out.print(i + 1); } //System.out.println(); } } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报