提交时间:2023-07-16 17:48:28

运行 ID: 23793

#include <bits/stdc++.h> using namespace std; int s[1000010]; int a,b,t; bool check(int x){ while(x){ if(x%10==7)return true; x/=10; } return false; } int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin>>a>>b; for(int i=a;i<=b;i++){ if(i%7==0||check(i)){ s[t]=i; t++; } } cout<<t<<endl; for(int i=0;i<t;i++){ cout<<s[i]<<endl; } }