public class MyOwn {
public static void main(String[] args) {
int count = 0;
for(int i = 1; i <= 198; i++) {
if(i % 5 != 0) {
count++;
if(count % 5 == 0) {
System.out.print(i+" ");
System.out.println('\n');
} else {
System.out.print(i+" ");
}
}
}
}
}
Java 每五个一行输出1-100不能被5整除的数
最新推荐文章于 2022-07-25 15:22:54 发布