2022级统计计算机双学位《程序设计原理与C语言》上机作业

1038. Expands shorthand notations

单点时限: 2.0 sec

内存限制: 512 MB

Write a program that expands shorthand notations like a-z in the string $s_1$ into the equivalent complete list abc...xyz in $s_2$. Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. Arrange that a leading or trailing - is taken literally.

You can assume that the input string does not exceed $10$, only contains letters of both cases, digits, and -.

样例

Input
a-z
Output
abcdefghijklmnopqrstuvwxyz
Input
a-b-c
Output
abc
Input
a-z0-9
Output
abcdefghijklmnopqrstuvwxyz0123456789
Input
-a-z
Output
-abcdefghijklmnopqrstuvwxyz
Input
abcA-C
Output
abcABC