逢七过java版
package Com;
//i%10==7是指个位(只能一个)被7整除
//i/10%10==7是指在/10取得十位前提下在%10确保余数等于7
//i%7==0是指整体下被7整除
public class Demon19 {
public static void main(String[] args) {
for (int i = 1; i <=100;i++){
if(i%7==0||i/10%10==7||i%10==0){
System.out.println(i);
}
}
}
}