Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
23764 | yihang | 直播获奖CSP2020 J组 | C++ | 解答错误 | 0 MS | 276 KB | 426 | 2023-07-16 17:14:50 |
#include"bits/stdc++.h" using namespace std; long long s[1000000]; int sd(int x){ if(x%7==0)return true; while(x){ if(x%10==7){ return true;} x/=10;} return false;} int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n,m,ans=0; cin>>n>>m; for(int i=n;i<=m;i++){ if(sd(i)){ s[i]=i; ans++;} } cout<<ans<<endl; for(int i=n;i<=ans+m;i++){ if(s[i]!=0)cout<<s[i]<<endl; }}