要求的是2……
by Alpex @ 2022-08-01 11:38:10
```cpp
#include<iostream>
#include<iostream>
using namespace std;
int main()
{
long long l, r, s = 0, n;
cin >> l >> r;
for(int i = l; i <= r; i++)
{
int j = i;
while(j) // 和 j != 0是一样的
{
if(j % 10 == 2)
{
s++;
}
j /= 10;
}
}
cout << s;
return 0;
}
```
by huangronuxuan @ 2022-08-01 12:05:36
~~题目统计的是2有多少个~~
by xueshenzhixing @ 2022-08-01 12:30:18
┗|`O′|┛ 嗷~~
看错题目啦,谢谢各位大佬。
by txtxdy @ 2022-08-01 13:54:37
@[Alpex](/user/664620) 感谢,我也眼瞎了
by lsiuf @ 2022-10-10 10:35:41