//找出小於100 的整數裡,所有可以被2 與3 整除,但不能被12
//整除的整數。
public class P5_3_24 {
public static void main(String[] args) {
int x=1;
while(x<100){
if(x%2==0&&x%3==0){
if(x%12!=0){
System.out.print(x+" ");
}
}x++;
}
}
}
//6 18 30 42 54 66 78 90
文章標籤
全站熱搜