Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int N;
- cin >> N;
- int a[N];
- for (int i=0;i<N;i++) {
- cin >> a[i];
- }
- for (int h=0;h<N;h++) {
- if (a[h]%2==0) {
- cout << a[h] << " ";
- }
- }
- cout << endl;
- for (int y=N-1;y>=0;y--) {
- if (a[y]%2!=0) {
- cout << a[y] << " ";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement