Advertisement
Guest User

Десятая кароч

a guest
Jan 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int N;
  5.     cin >> N;
  6.     int a[N];
  7.     for (int i=0;i<N;i++) {
  8.         cin >> a[i];
  9.     }
  10.     for (int h=0;h<N;h++) {
  11.         if (a[h]%2==0) {
  12.             cout << a[h] << " ";
  13.         }
  14.     }
  15.     cout << endl;
  16.     for (int y=N-1;y>=0;y--) {
  17.         if (a[y]%2!=0) {
  18.             cout << a[y] << " ";
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement