#K13321. Separate and Concatenate Alphanumeric Characters
Separate and Concatenate Alphanumeric Characters
Separate and Concatenate Alphanumeric Characters
In this problem, you are given a string S containing various characters. Your task is to create a new string by first extracting all alphabetical characters (i.e., both lowercase and uppercase letters) from S in their original order, and then appending all digit characters (0-9) from S in their original order. Note that any other symbols or special characters should be ignored.
For example, given the string "a1b2c3", the alphabetical characters are 'a', 'b', 'c' and the digits are '1', '2', '3', so the output should be "abc123".
This problem tests your ability to iterate over strings and conditionally select characters. It is an easy-level problem and focuses on basic string manipulation.
inputFormat
Input is given from standard input (stdin) as a single line string S that may contain letters, digits, and other symbols.
outputFormat
Output to standard output (stdout) should be the concatenated result string, with all letters first (in original order) followed by all digits (in original order).## sample
a1b2c3
abc123