简单而强大
#include <iostream>
#include <algorithm>
#include <cstring>
using namespace std;
int x;
int cnt;
bool check(int x)
{
int count = 1;
while (x)
{
int t = x % 10;
if (count % 2 == 0 && t % 2 == 1) return false;
if (count % 2 == 1 && t % 2 == 0) return false;
x /= 10;
count++;
}
return true;
}
int main()
{
cin >> x;
for (int i = 1; i <= x; i++) if (check(i)) cnt++;
cout << cnt << endl;
return 0;
}
包会的
太强了
那包强的。你以为