文章
1
粉丝
126
获赞
0
访问
3.2k
#include <bits/stdc++.h>
using namespace std;
int main(){
unsigned left, right;
cin >> left >> right;
unsigned count = 0;
for (unsigned i = left; i <= right; ++i)
{
if (i / 10000 == 2)
{
count++;
}
if ((i / 1000) % 10 == 2)
{
count++;
}
if ((i / 100) % 10 == 2)
{
count++;
}
if ((i / 10) % 10 == 2)
{
count++;
}
if (i % 10 == 2)
{
count++;
}
}
cout << count << endl;
return 0;
}
登录后发布评论
暂无评论,来抢沙发