public class Test {
public static void main(String[] args) {
for(int i = 100;i<=200;i++){
boolean bool = true;
if(i%4!=2)
bool= false;
if(i%7!=3)
bool= false;
if(i%9!=5)
bool= false;
if(bool)
System.out.println("总数为:"+i);
}
}
}
public class test {
public static void main(String args[]){
for(int i=100;i<=200;i++){
if(i%4==2&&i%7==3&&i%9==5){
System.out.println(i);
}
}
}
}
输出:122
public class ToolsTest {
public static void main(String args[]){
int i=14;
while(true){
if(i%4==2 && i%7==3 && i%9==5){
System.out.println("这堆零件为"+i+"个");
break;
}
i++;
}
}
}
public class Test {
public static void main(String[] args) {
int min = 100;
int max = 200;
for(int i = min; i <= max; i++)
if(i % 4 == 2 && i % 7 == 3 && i % 9 == 5)
System.out.println("num = " + i);
}
}
楼上都是正解