#K14421. Merge Sorted Strings
Merge Sorted Strings
Merge Sorted Strings
Given n strings, the task is to sort them in alphabetical order and then concatenate them into a single string.
You will read the input from the standard input (stdin
) and print the result to the standard output (stdout
).
The input format is as follows:
- The first line contains an integer n, representing the number of strings.
- The next n lines each contain a single string.
The output is the concatenated string after sorting all input strings in alphabetical order.
Note: All strings consist of lowercase letters.
inputFormat
The input begins with an integer n (1 ≤ n ≤ 105), followed by n lines each containing a string. Each string's length is at most 100, and consists only of lowercase letters.
outputFormat
Output a single line containing the concatenated string formed by sorting the provided strings in alphabetical order.
## sample3
dog
cat
frog
catdogfrog