#C12376. Count Character Types
Count Character Types
Count Character Types
You are given a string s
which may contain letters, digits, whitespace, and punctuation characters. Your task is to count the number of letters, digits, and special characters in the string.
For the purpose of this problem, a letter is any character for which isalpha()
returns true, a digit is any character for which isdigit()
returns true, and a special character is any character that is neither a letter nor a digit (this includes whitespace, punctuation, etc.).
You need to output three numbers separated by a single space corresponding to the counts of letters, digits, and special characters respectively.
Mathematically, if we denote:
- $L$ = number of letters
- $D$ = number of digits
- $S$ = number of special characters
Then, given the input string s
, compute and output: L D S
.
inputFormat
The input consists of a single line containing the string s
. The string may include spaces and other special characters.
outputFormat
Output three integers separated by a single space which represent the counts of letters, digits, and special characters in the given string, in that order.
## sampleHelloWorld
10 0 0