PROGRAMMING:Page printing of office document
In the office software (word, Excel), sometimes only a part of the whole document needs to be printed, and the user needs to select the page range to be printed. At present, the format of page number range is defined as: separated by comma, and - can be used to represent continuous page number. For example: 1,3,5-9,20. Indicates that the page numbers to be printed are 1, 3, 5, 6, 7, 8, 9 and 20.
This topic requires reading a line of string as the page number range to be printed. The following points should be noted:
*1. The page number range can be entered out of order. For example: 5,3,7,9-10,1-2;
*2. Consecutive page number definitions may not be entered in descending order. For example: 1,9,5,20-15,10;
*3. The page number range may be repeated. For example: 1,9,15,5-10,12-20;
###Input format:
First line: a formatted string that represents the range of page numbers
###Output format:
The page numbers to be printed are output in the order of * * from small to large * * and separated by spaces
###Input example:
```in
1,3,5-9,20
```
###Output example:
```out
1 3 5 6 7 8 9 20
```
###Input example:
```in
12-20,1,15,9,5-10
```
###Output example:
```out
1 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20
```
answer:If there is no answer, please comment
This topic requires reading a line of string as the page number range to be printed. The following points should be noted:
*1. The page number range can be entered out of order. For example: 5,3,7,9-10,1-2;
*2. Consecutive page number definitions may not be entered in descending order. For example: 1,9,5,20-15,10;
*3. The page number range may be repeated. For example: 1,9,15,5-10,12-20;
###Input format:
First line: a formatted string that represents the range of page numbers
###Output format:
The page numbers to be printed are output in the order of * * from small to large * * and separated by spaces
###Input example:
```in
1,3,5-9,20
```
###Output example:
```out
1 3 5 6 7 8 9 20
```
###Input example:
```in
12-20,1,15,9,5-10
```
###Output example:
```out
1 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20
```
answer:If there is no answer, please comment