提交时间:2023-12-31 14:49:15

运行 ID: 33913

#include <bits/stdc++.h> using namespace std; int a,b,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)){ t++; } } cout<<t<<endl; for(int i=a;i<=b;i++){ if(i%7==0||check(i)) cout<<i<<endl; } }