#C12815. Character Categorization
Character Categorization
Character Categorization
You are given a string consisting of uppercase letters, lowercase letters, digits, and special characters. Your task is to count the number of uppercase letters, lowercase letters, digits, and special characters in the string.
If the input string is empty, you should output the error message Error: The input string is empty
.
The counts should be calculated as follows:
- Uppercase letters: characters in the range $A-Z$
- Lowercase letters: characters in the range $a-z$
- Digits: characters in the range $0-9$
- Special characters: all other characters
Note: All formulas are represented in LaTeX format. Read the input from standard input and write your result to standard output.
inputFormat
A single line string that may contain uppercase letters, lowercase letters, digits, and special characters. The input is read from standard input.
outputFormat
If the input string is non-empty, output a single line in the following format:
uppercase: X, lowercase: Y, digits: Z, special_characters: W
where X, Y, Z, and W are the respective counts. If the input string is empty, output exactly:
Error: The input string is empty## sample
HelloWorld123!@#
uppercase: 2, lowercase: 8, digits: 3, special_characters: 3