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

PROGRAMMING:Parity separation

Luz5年前 (2021-05-10)题库369
###Task description
There is a positive integer k (2 < = k < = 10000). What you need to do is: first output all odd numbers from 1 to K from small to large, and then output all even numbers from small to large.
###Input format:
An integer n (2 < = n < 30) in the first line indicates that there are n groups of test data;
After n lines, each line has an integer number K.
###Output format:
For each group of data:
The first line outputs all odd numbers (there are no spaces at the end of the line)
The second line outputs all even numbers (no spaces at the end of the line)
Each group of data is followed by a newline.
###Input example:
```in
two
ten
fourteen
```
###Output example:
```out
1 3 5 7 9
2 4 6 8 10
1 3 5 7 9 11 13
2 4 6 8 10 12 14
```
###Title Source
Note: this topic is selected from nyoj website http://nyoj.top/problem/11
###Problem analysis:
This problem is relatively simple, pay attention to the data output format.







answer:If there is no answer, please comment