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 s[1000]; int freq[10] = {0}; scanf("%[^\n]", s); for (int i = 0; i < strlen(s); i++) { if (s[i] >= '0' && s[i] <= '9') { freq[s[i] - '0']++; } } for (int i = 0; i < 10; i++) { printf("%d ", freq[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 →
include
include
include
include
int main() {
}