Problem N parity separation

    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 a, b;
    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

    Previous Post: Why does the iPhoneX choose to use a stainless steel middle frame? Because of this high performance material!
    Next Post: Littelfuse transient suppression diode array provides lightning induced surge and ESD protection
    Home
    Recent Posts
    • MAX6503UKP005-T
    • Introduction to the composition of mobile phone …
    • How to use embedded technology to realize face d…
    • In the era of big data, chip IC design is diffic…
    • Create a private living room theater TCL C2 thea…
    • Hisense PX520 installs third-party applications …
    • True Garden Country: Singapore Double 12 on-line…
    • Depth analysis of water meter use regulations an…
    • This little thing that is the most happy this wi…
    • All you want is for you to go home from work
    • Hisense LEDEC550UA installs a sofa butler throug…
    • Beisen Technology has been exposed to tens of mi…
    • Haier LS49A51 how to install third-party applica…
    • Hisense LED48EC290N installs third-party applica…
    • TriQuint's new integrated low noise amplifie…
    • What are the brands of good home smart anti-thef…
    • Do you want mechanical hard disk to hurry up? Tr…
    • HMC1001
    • On the test method of gold purity and K number -…
    • It is about every LED practitioner! 2017 LED ind…