Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
42068 吴思睿 幸运数字 C++ 通过 100 73 MS 248 KB 362 2022-06-22 19:04:39

Tests(5/5):


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


测评信息: