View Code of Problem 107

#include<stdio.h>
// 二刷 
int main(){
	int cishu[10]={0};
	int m, n;
	while(scanf("%d %d", &m, &n) != EOF) { //输入包含多组数据
		int num = 0;
		for(int i=m; i<=n; i++){
			do{
				num = i % 10;
				cishu[num]++;
				i /= 10;
			}while(i % 10 == 0);	
		}
		
		for(int i=0; i<10; i++){
			if(i==0) printf("%d", cishu[0]);
			else printf(" %d", cishu[i]);
		}
		printf("\n");
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 107