Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int c,n,i,a[15],j,k,l;
- scanf("%d",&c);
- for(i=1;i<=c;i++){
- for(j=0;j<=10;j++){
- a[j]=0;
- }
- scanf("%d",&n);
- for(j=1;j<=n;j++){
- l=j;
- while(l!=0){
- k=l%10;
- a[k]++;
- l=l/10;
- }
- }
- for(j=0;j<10;j++){
- printf("%d",a[j]);
- if(j<9)
- printf(" ");
- }
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement