位运算写法
#include <iostream>
using namespace std;
using ll = long long;
int main() {
int res = 0;
int n = 0;
cin >> n;
for (int i = 1; i <= n; i += 2) {
bool tag = 1;
int x = i;
while (x) {
if ((x & 1) ^ tag)
goto End;
tag ^= 1;
x /= 10;
}
++res;
End:
;
}
cout << res << '\n';
return 0;
}
1 回复
0 转发
1 喜欢
6 阅读



