提交时间:2023-07-18 09:31:22

运行 ID: 23905

#include<bits/stdc++.h> using namespace std; int a,b,t=0,s[1000000]; bool abc(int x){ int l; for(int j=x;j>=1;j/=10){ if(j%10==7)return true; } return false; } int main() { cin>>a>>b; for(int i=a;i<=b;i++){ if(i%7==0){ if(i%10!=7&&i%10!=0){ t++; s[t]=i; } } if(abc(i)){ t++; s[t]=i; } } cout<<t<<endl; for(int i=1;i<=t;i++){ cout<<s[i]<<endl; } return 0; }