编译成功

测试数据 #0: Accepted, time = 0 ms, mem = 244 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 248 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 244 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 244 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 248 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 248 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 244 KiB, score = 10
测试数据 #7: Accepted, time = 15 ms, mem = 248 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 244 KiB, score = 10
测试数据 #9: Accepted, time = 0 ms, mem = 248 KiB, score = 10
Accepted, time = 15 ms, mem = 248 KiB, score = 100
代码
#include"stdio.h"

int main()
{
int l,r,i,j,count=0;
scanf("%d %d",&l,&r);
for(i=l;i<=r;i++)
{
j=i;
while(j!=0)
{
if(j%10==2)
{count++;}
j=j/10;
}
}
printf("%d",count);
return 0;
}

0 条评论

目前还没有评论...

信息

ID
1784
难度
2
分类
模拟 点击显示
标签
递交数
2764
已通过
1664
通过率
60%
被复制
19
上传者