Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
41434 | 杨中琦 | 幸运数字 | C++ | Accepted | 100 | 9 MS | 248 KB | 283 | 2022-06-12 07:03:07 |
#include <bits/stdc++.h> using namespace std; bool check(int a) { if(a%4==0||a%7==0) return true; while(a) { if(a%100==44||a%100==77) return true; a/=10; } return false; } int main() { int i,n,s=0; cin>>n; for(i=1;i<=n;i++) if(check(i)) s++; cout<<s; }