比赛 20150711暑期B班 评测结果 AAAAAAAAAA
题目名称 计数问题 最终得分 100
用户昵称 123 运行时间 0.107 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2015-07-11 09:24:18
显示代码纯文本
#include <iostream>
#include <cstdio>
#include <cmath>
int r,a,b;
using namespace std;
void qw(int f)
{
	int e,g;
	g=f;
	if(f<=a)
	{
		for (e=1;g!=0;e++)
		{
			if(g%10==b)
			{
				r++;
			}
			g=g/10;
		}
		qw(f=f+1);
	}
}
	
int main(){
	freopen ("count2013.in","r",stdin);
	freopen ("count2013.out","w",stdout);
	int c,d,e,g;
	cin>>a;
	cin>>b;
	qw(1);
	cout<<r;
	return 0;
}