2.代码实现
import java.util.Scanner;
public class Main678 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
for (int i = 1; i <= n; i++) {
if (i % 7 == 0) {
System.out.println(i);
}
else {
int t = i;
while (t > 0) {
if (t % 10 == 7) {
System.out.println(i);//为什么这边不能写t
break;
}
t /= 10;//以七开头的数
}
}
}
}
}