12345678910111213141516171819 |
- #include <stdio.h>
- #include <ctype.h>
- int main() {
- char ch;
- int letters = 0, digits = 0;
- while ((ch = getchar()) != EOF) {
- if (isalpha(ch)) {
- letters++;
- } else if (isdigit(ch)) {
- digits++;
- }
- }
- printf("%d %d\n", letters, digits);
- return 0;
- }
|