package itcast;
public class First {
/**
* 7的倍数,出现7的
*/
public static void main(String[] args) {
String str ="";
for(int i = 0;i <= 100;i++) {
if(i / 10 == 7 || i % 10 == 7|| i / 7 == 0 ) {
str = str + "过 ";
}else {
str = str + i + " ";
}
}
System.out.println(str);
}
}
|
|