You are viewing a single comment's thread. Return to all comments →
char arr[100000]; scanf("%s", arr); int d=strlen(arr); int a[9]={0};
for(char i='0'; i<='9'; i++){ for (int k=0; k<d;k++){ if(i==arr[k]){ a[i-48]++; } } } for(int j=0; j<=9;j++){ printf("%d"" ", a[j]); } // for(int* k=0; k<9;k++){ // for(int l=0; l<20;l++){ // if(k==arr[l]){ // arr[k]==arr[k+1];} // } // } return 0;
Seems like cookies are disabled on this browser, please enable them to open this website
Digit Frequency
You are viewing a single comment's thread. Return to all comments →
char arr[100000]; scanf("%s", arr); int d=strlen(arr); int a[9]={0};