-->
当前位置:首页 > 题库

PROGRAMMING:A clear random number

Luz5年前 (2021-05-10)题库562
###Task description
Mingming wants to invite some students to do a questionnaire survey in the school. For the objectivity of the experiment, he first generated N random integers (n ≤ 100) between 1 and 1000 by computer. For the repeated numbers, only one is reserved, and the rest of the same numbers are removed. Different numbers correspond to different student numbers. Then sort the numbers from small to large, and go to the students to do the survey according to the order. Please help Mingming complete the work of "de duplication" and "sorting".
###Input format:
Input has 2 lines, the first line is a positive integer, which means the number of generated random numbers: n
The second line has n positive integers separated by spaces, which are the generated random numbers.
###Output format:
The output is also 2 lines. The first line is a positive integer m, which represents the number of different random numbers. The second line is m positive integers separated by spaces, which are different random numbers arranged from small to large.
###Input example:
```in
ten
20 40 32 67 40 20 89 300 400 15
```
###Output example:
```out
eight
15 20 32 40 67 89 300 400
```
###Title Source
Note: selected from RQNOJ website, online address: https://www.rqnoj.cn/problem/1






answer:If there is no answer, please comment