提交时间:2023-12-31 14:46:01

运行 ID: 33907

#include <bits/stdc++.h> using namespace std; const int N=1e6+10; int a,b,s[N],t; bool check(int x){ while(x){ if(x%10==7)return true; x/=10; } return false; } int main(){ 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; } }