You can never win a war. Ask the great God to tell me what's wrong.

Source: Internet
Author: User
Ask the great God to tell me what's wrong. Odd even separation time limit:ms | Memory limit:65535 KB Difficulty:1
Describe
There is an integer even n (2<= n <=10000), you have to do is: first 1 to N of all the odd numbers from small to large output, and then all the even from small to large output.
Input
The first line has an integer I (2<=i<30) that indicates that I have a set of test data;
Each group has an integral type even n.
Output
The first line outputs all the odd numbers
The second line outputs all the even numbers

#include <stdio.h>
#include <stdlib.h>
int main ()
{
int n,i=1;
scanf ("%d", &n);
for (i=1;i<=n;)
{
printf ("%d", I);
i=i+2;
}
printf ("\ n");
for (i=2;i<=n;)
{
printf ("%d", I);
i=i+2;
}
return 0;
}

You can never win a war. Ask the great God to tell me what's wrong.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.