| 记录编号 | 591648 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 984.[NOIP 2010PJ]数字统计 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.028 s | ||
| 提交时间 | 2024-07-20 09:05:01 | 内存使用 | 3.37 MiB | ||
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("twoj.in","r",stdin);
freopen("twoj.out","w",stdout);
int l,r,x,g,s;
cin>>l>>r;
for(int i=l;i<=r;i++)
{
x=i;
while(x)
{
g=x%10;
if(g==2) s++;
x=x/10;
}
}
cout<<s;
fclose(stdin);fclose(stdout);
return 0;
}