好数暴力枚举
include [HTML_REMOVED]
using namespace std;
bool god(int a)
{
int cnt=1;
while(a>0)
{
if(cnt)
{
cnt=0;
if(a%10%2==0) return false;
a/=10;
}else{
cnt=1;
if(a%10%2==1) return false;
a/=10;
}
}
return true;
}
int main()
{
int n;
cin>>n;
int s=0;
for(int i=1;i<=n;i){
if(god(i)) s;
}
printf(“%d”,s);
}