Java怎么用do while做乘法表

交互式爱情
浏览 1054回答 2
2回答

慕桂英4014372

public class Demo01 {&nbsp;&nbsp; &nbsp; @Test&nbsp; &nbsp; public void test() {&nbsp; &nbsp; &nbsp; &nbsp; int i = 1, mul = 1;&nbsp; &nbsp; &nbsp; &nbsp; do {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; do {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.print(mul + "*" + i + "=" + (i * mul) + "\t");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mul++;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } while (mul <= 9);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.out.println();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i++;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mul = 1;&nbsp; &nbsp; &nbsp; &nbsp; } while (i <= 9);&nbsp; &nbsp; }&nbsp;}
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java