#C9555. String Compression
String Compression
String Compression
Given a string s, compress it by replacing each group of consecutive identical characters with the character followed by the number of occurrences in that group. For example, the string "aaabbccccdaa" should be compressed to "a3b2c4d1a2".
The problem requires you to read the input from standard input (stdin) and output your result to standard output (stdout).
Note: If the input string is empty, your program should output an empty string.
Example:
Input: aaabbccccdaa Output: a3b2c4d1a2
inputFormat
The input consists of a single line containing the string s which is to be compressed. The string may contain both uppercase and lowercase letters.
outputFormat
The output is a single line containing the compressed form of the input string. Each group of consecutive identical characters is replaced by the character followed by the count of its occurrences.
## sampleaaabbccccdaa
a3b2c4d1a2