| 比赛 | 20150711暑期B班 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 计数问题 | 最终得分 | 100 |
| 用户昵称 | 1azyReaper | 运行时间 | 0.096 s |
| 代码语言 | C++ | 内存使用 | 0.31 MiB |
| 提交时间 | 2015-07-11 08:40:00 | ||
#include <fstream>
using namespace std;
ifstream fin("count2013.in");
ofstream fout("count2013.out");
int main()
{
int n,x,ans=0;
fin>>n>>x;
for(int i=1;i<=n;i++)
{
int j=i;
while(j>0)
{
if(j%10==x)
{
ans++;
}
j/=10;
}
}
fout<<ans<<endl;
return 0;
}