| 比赛 | 2010年noip | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 数字统计 | 最终得分 | 100 |
| 用户昵称 | 梦那边的美好ET | 运行时间 | 0.004 s |
| 代码语言 | C++ | 内存使用 | 3.16 MiB |
| 提交时间 | 2018-05-17 19:40:46 | ||
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<cstring>
#include<algorithm>
using namespace std;
int a,b,ans=0,f;
int main()
{
freopen("twoj.in","r",stdin);
freopen("twoj.out","w",stdout);
cin>>a>>b;
for(int i=a;i<=b;i++)
{
f=i;
while(f!=0)
{
if(f%10==2)ans+=1;
f/=10;
}
}
cout<<ans;
return 0;
}