You are viewing a single comment's thread. Return to all comments →
int main() {
char s[1000]; scanf("%s",&s); int arr[100]; for(int i=0;i<10;i++){ int fre =0; for(int j=0;j<strlen(s);j++){ int num = s[j]-'0'; if (num==i){ fre=fre+1; } } arr[i]=fre; } for (int i=0;i<10;i++){ printf("%d ",arr[i]); } 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 →
int main() {
}