SPLIT INTO TWO


Submit solution

Points: 5 (partial)
Time limit: 10.0s
Memory limit: 10M

Author:
Problem type
Allowed languages
C

Given an integer array, write a C program to separate odd numbers and even numbers into separate arrays. Print them in two lines in the same order they occur in the initial array.

INPUT FORMAT

N - size of the array

List of integers separated by single space

OUTPUT FORMAT

LIST OF ODD NUMBERS SEPARATED BY SPACE

LIST OF EVEN NUMBERS SEPARATED BY SPACE

Example

SAMPLE INPUT

 10
 1 2 3 4 5 6 7 8 9 10

SAMPLE OUTPUT

 1 3 5 7 9
 2 4 6 8 10

Comments

There are no comments at the moment.