Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|---|
41944 | 202103bhfy | 幸运数字 | C++ | Accepted | 100 | 9 MS | 248 KB | 308 | 2022-06-19 15:21:38 |
#include<bits/stdc++.h> using namespace std; int check(int n){ if(n%4==0||n%7==0){ return 1; } while(n){ if(n%100==44||n%100==77) return 1; n/=10; } return 0; } int main(){ int sum=0,n; cin>>n; for(int i=1;i<=n;i++){ int t=i; sum+=check(i); } cout<<sum; return 0; }