1 回答
已采纳

guozhchun
TA贡献103条经验 获得超76个赞
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | public class Test { public static void main(String[] args) { int count = 0 ; // 有多少个不能被7整数的数 for ( int i = 1 ; i <= 100 ; i++) { // 不能被 7 整除 if (i % 7 != 0 ) { // 数量是 4 的整数倍,需要换行 if (count % 4 == 0 ) System.out.println(); System.out.print(i + " " ); // 输出该数 count++; // 更新数量 } } } } |
没有找到匹配的内容?试试慕课网站内搜索吧
添加回答
举报
0/150
提交
取消