| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 74588 | 李言 | 幸运数字 | C++ | Accepted | 100 | 15 MS | 256 KB | 325 | 2023-05-27 16:34:05 |
#include<bits/stdc++.h> using namespace std; int n,ans; int check(int x){ if(x%4==0) return 1; if(x%7==0) return 1; int k=0; while(x){ if((k==4&&x%10==4)||(k==7&&x%10==7)) return 1; k=x%10; x/=10; } return 0; } int main(){ cin>>n; for(int i=1;i<=n;i++) ans+=check(i); cout<<ans; return 0; }