第一条题解
2026-01-17 10:23:37
发布于:浙江
6阅读
0回复
0点赞
#include<iostream>
#include<string>
using namespace std;
bool c(int num,int base){
if(base==10){
int temp=num;
while(temp>0){
if(temp%10==7){
return true;
}
temp/=10;
}
return false;
}else if(base==8){
int temp=num;
while(temp>0){
if(temp%8==7){
return true;
}
temp/=8;
}
return false;
}
return false;
}
int main(){
int n;
cin>>n;
int co=0;
for(int i=1;i<=n;i++){
if(!c(i,10)&&!c(i,8)){
co++;
}
}
cout<<co;
}
这里空空如也







有帮助,赞一个