package com.eduask.circulationDemo;
/*
*
* 1.把100——200中不能被3整除的数输出,每四个换一行输出
*/
public class testDemo01 {
public static void main(String[] args) {
int j = 0;
for(int i=100; i<=200; i++){
if (i%3 != 0) {
j++;
System.out.print(i+" ");
if (j%4 == 0) {
System.out.print(‘\n‘);
}
}
}
}
}
运行结果:100 101 103 104
106 107 109 110
112 113 115 116
118 119 121 122
124 125 127 128
130 131 133 134
136 137 139 140
142 143 145 146
148 149 151 152
154 155 157 158
160 161 163 164
166 167 169 170
172 173 175 176
178 179 181 182
184 185 187 188
190 191 193 194
196 197 199 200