提交时间:2023-07-16 16:55:46

运行 ID: 23738

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