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