提交时间:2022-06-18 15:19:28

运行 ID: 41836

#include <bits/stdc++.h> using namespace std; int main () { int a, sum = 0, t, n; cin >> a; for (int i = 1; i <= a; i++) { n = i; if (n % 4 == 0) { sum += 1; continue; } if (n % 7 == 0) { sum += 1; continue; } while (n) { if (n % 100 == 44 || n % 100 == 77) { sum += 1; } n/=10; } } cout << sum; return 0; }