1 solutions
-
0
C++ :
#include<bits/stdc++.h> using namespace std; //将整数转换为string string tos(int n){ string s = ""; while(n != 0){ s = (char)(n % 10 + 48) + s; n = n / 10; } return s; } int main(){ int i,n,c = 0; string s; cin>>n; for(i = 1;i <= n;i++){ s = tos(i); if(i % 4 == 0 || i % 7 == 0 || (s.find("44") != -1 || s.find("77") != -1)){ c++; } } cout<<c<<endl; return 0; }
- 1
Information
- ID
- 10076
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By