The title description has an integer even number n (2 <= n <= 10000). What you have to do is to first output all odd numbers from 1 to n from small to large, and then output all even numbers from small to large.
Enter the first line with an integer i (2<=i<30) to indicate that there are i groups of test data;
Each group has an integer even number n.
Output the first line to output all the odd numbers. The second line outputs all the even numbers (there are spaces at the end of the line, one blank line per group)
Sample input
2
10
14
Sample output
1 3 5 7 9
2 4 6 8 10
1 3 5 7 9 11 13
2 4 6 8 10 12 14
#include
#include
Using namespace std;
Int main()
{
Int num;
Cin >> num;
Int x[10000];
For(int i=0;i
Cin >> x[i];
}
Vector
For (int i = 0; i < num; i++)
{
For (int j = 1; j <= x[i]; j++)
{
If (j % 2)
A.push_back(j);
Else
B.push_back(j);
}
For (int j = 0; j < a.size(); j++)
{
Cout << a.at(j) << " ";
}
Cout << endl;
For (int j = 0; j < a.size(); j++)
{
Cout << b.at(j) << " ";
}
Cout << endl << endl;
A.clear();
B.clear();
}
}
MTB-CUT 180AL Hydrogel Film Cutter
Professional Mtb-Cut 180Al Hydrogel Film Cutter manufacturer is located in China, including Hydrogel Film Cutter,Phone Protector Machine,Mobile Cover Cutting Machine, etc.Professional Mtb-Cut 180Al Hydrogel Film Cutter manufacturer is located in China, including Hydrogel Film Cutter,Phone Protector Machine,Mobile Cover Cutting Machine, etc.Professional Mtb-Cut 180Al Hydrogel Film Cutter manufacturer is located in China, including Hydrogel Film Cutter,Phone Protector Machine,Mobile Cover Cutting Machine, etc.Professional Mtb-Cut 180Al Hydrogel Film Cutter manufacturer is located in China, including Hydrogel Film Cutter,Phone Protector Machine,Mobile Cover Cutting Machine, etc.
Mtb-Cut 180Al Hydrogel Film Cutter,Hydrogel Film Cutter,Phone Protector Machine,Mobile Cover Cutting Machine
Mietubl Global Supply Chain (Guangzhou) Co., Ltd. , https://www.mietublmachine.com