| 记录编号 | 169959 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1423.[NOIP 2013]计数问题 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.100 s | ||
| 提交时间 | 2015-07-11 15:35:43 | 内存使用 | 0.31 MiB | ||
#include<fstream>
using namespace std;
int pd(int n,int x){
	int a=0;
	while(n>0){
		if(n%10==x){
			a++;}
		n=n/10;}
return a;}
int main(){
	ifstream fin("count2013.in");
	ofstream fout("count2013.out");
	int c,x,i,ans=0;
	fin>>c>>x;
	for(i=1;i<=c;i++){
		ans=ans+pd(i,x);}
	fout<<ans;
	fin.close();
	fout.close();
	return 0;
}