| 记录编号 | 46923 | 评测结果 | AAAAAAAAAA | 
    
        | 题目名称 | 1146.计数器 | 最终得分 | 100 | 
    
        | 用户昵称 |  cstdio | 是否通过 | 通过 | 
    
        | 代码语言 | C++ | 运行时间 | 0.003 s | 
    
        | 提交时间 | 2012-10-29 21:31:27 | 内存使用 | 3.15 MiB | 
    
    
    
    		显示代码纯文本
		
		#include<iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
using namespace std;
int n,s[10]={0};
int checkitout(int p){//统计10^p位上的各数字个数
	int temp=(int)pow(10,(double)p),x=temp*10,a,b=n,c=0,i;
	a=n/x;
	for(i=0;i<=9;i++) s[i]+=a*temp;
	s[0]-=temp;
	b%=x;
	b++;
	while(b>=temp){
		s[c]+=temp;
		b-=temp;
		c++;
	}
	s[c]+=b;
}
int main(){
	freopen("count1.in","r",stdin);
	freopen("count1.out","w",stdout);
	scanf("%d",&n);
	int temp,i;
	temp=floor(log10((double)n)+1);
	for(i=0;i<temp;i++) checkitout(i);
	for(i=0;i<10;i++) printf("%d\n",s[i]);
	return 0;
}