| 记录编号 | 141506 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 984.[NOIP 2010PJ]数字统计 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.005 s | ||
| 提交时间 | 2014-12-02 18:50:21 | 内存使用 | 0.31 MiB | ||
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
main()
{
freopen("twoj.in","r",stdin);
freopen("twoj.out","w",stdout);
char s[10];
int a=0,e,i,j,l,r;
cin>>l>>r;
for(i=l;i<=r;i++)
{
sprintf(s,"%d",i);
e=strlen(s);
for(j=0;j<e;j++)
if(s[j]=='2')
a++;
}
cout<<a;
}