happy
2024-07-29 14:01:08
发布于:浙江
#include <iostream>
using namespace std;
long long n,c,ans=0;
long long check(int a) {
long long cnt=1;
bool flag[8] = {};
while (a) {
long long b = a % 10;
if (b != 7 and b != 5 and b != 3) {
return cnt;
}flag[b]=true;
cnt *= 10;
a/=10;
}
if (flag[7] and flag[5] and flag[3]) {
return 0;
}else return 1;
}
int main() {
freopen("number.in","r",stdin);
freopen("number.out","w",stdout);
cin >> n;
for (long long i = 357;i <= n;i += c) {
c=check(i);
if (c == 0) {
ans ++;
i ++;
}
}cout << ans;
fclose(stdin);
fclose(stdout);
return 0;
}
这里空空如也
有帮助,赞一个