SHARE
TWEET

488

CristinaGeorgiu Jan 22nd, 2020 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<iostream>
  2. using namespace std;
  3. int v[1001];
  4. int main()
  5. {
  6.     int n,i;
  7.     cin>>n;
  8.     for(i=1;i<=n;i++)
  9.     {
  10.         cin>>v[i];
  11.     }
  12.     for(i=1;i<=n;i++)
  13.     {
  14.         if(v[i]%2==0)
  15.         {
  16.             cout<<v[i]<<" ";
  17.         }
  18.     }
  19.     cout<<endl;
  20.         for(i=n;i>=1;i--)
  21.         {
  22.             if(v[i]%2!=0)
  23.             {
  24.                 cout<<v[i]<<" ";
  25.             }
  26.         }
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top