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