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

PROGRAMMING:electric light

Luz5年前 (2021-05-10)题库388
It is known that there are 100 lights numbered 1-100 in the house, all of which are in the off state, and the existing numbers are A1, A2,... An's n boring people enter the house with this. The boring people with AI number reverses all the lights whose numbers are integral multiples of AI (turn off to turn on, turn on to turn off). Now the task is to find out the lights whose status is on. Many lights may be on, so for simplicity, when many lights are on, only 5 light numbers with smaller number will be output (the number will be output from small to large). When the number of lights on is less than 5, all lights on will be output. If all lights are off, 0 will be output;
###Input format:
First enter n, followed by the number of N boring people
###Output format:
When the number of lights turned on is less than 5, all the lights turned on will be output. If all the lights are turned off, 0 will be output; The output number is followed by a space
###Input example:
Here is a set of inputs. For example:
```in
two
one
two
one
one
```
###Output example:
The corresponding output is given here. For example:
```out
1 3 5 7 9
1 2 3 4 5
```







answer:If there is no answer, please comment