DT_M

关注

UVA1225 Digit Counting

DT_M

关注

阅读 64

2022-08-05


#include <stdio.h>
int main()
{
int n,i,j;
scanf("%d", &n);
while(n--){
int k,count[10] = {0};
scanf("%d", &k);
if(k == 0) count[0] = 1;
else
for(i=1; i<=k; i++)
{
j=i;
while(j!=0)
{
count[j%10]++;
j/=10;
}
}
for(i=0; i<9; i++)
printf("%d ",count[i]);
printf("%d\n",count[9]);
}
return 0;
}


相关推荐

纽二

UVa1225 - Digit Counting

纽二 56 0 0

Star英

UVA - 1225

Star英 216 0 0

小美人鱼失去的腿

算法竞赛入门经典-习题3-3 数数字 Digit Counting

小美人鱼失去的腿 48 0 0

一脸伟人痣

UVa 494 Kindergarten Counting Game (字符串处理)

一脸伟人痣 43 0 0

其生

1225. 正则问题(递归)

其生 74 0 0

灯火南山

Max Digit

灯火南山 98 0 0

舟海君

UVA-1225 数数字 题解答案代码 算法竞赛入门经典第二版

舟海君 56 0 0

westfallon

hdu Rightmost Digit

westfallon 57 0 0

不会弹吉他的二郎腿

HDU 1060 Leftmost Digit & BIT1046 Leftmost Digit

不会弹吉他的二郎腿 46 0 0

知年_7740

【codevs1225】八数码难题

知年_7740 54 0 0

精彩评论(0)

0 0 举报