753数解
2024-07-29 14:02:10
发布于:浙江
#include<iostream>
using namespace std;
long long a,ans=0,c;
long long check(long long num){
long long cnt=1;
bool c3=0,c5=0,c7=0;
while(num){
if(num%10==3){
c3=1;
}else if(num%10==5){
c5=1;
}else if(num%10==7){
c7=1;
}else{
return cnt;
}num/=10;
cnt*=10;
}if(c3 and c5 and c7){
return 0;
}else{
return 1;
}
}
int main(){
// freopen("number.in","r",stdin);
// freopen("number.out","w",stdout);
cin>>a;
for(long long i=356;i<=a;i+=c){
c=check(i);
if(c==0){
ans++;
i++;
}
}cout<<ans;
// fclose(stdin);
// fclose(stdout);
}
//100000000000000
//35735335757 好东西
这里空空如也
有帮助,赞一个