You are viewing a single comment's thread. Return to all comments →
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */ char str[1001]; int digit_count[10] = {0}; scanf("%s", str); for (int i = 0; i < strlen(str); i++) { if (str[i] >= '0' && str[i] <= '9') { digit_count[str[i] - '0']++; } } for (int i = 0; i < 10; i++) { printf("%d ", digit_count[i]); } printf("\n"); 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 →
include
include
include
include
int main() {
}