Untitled Paste
PublicAnonymous58 views
#include <iostream> using namespace std;int n, i, v[1001];int main(){ 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==1) cout<<v[i]<<" "; return 0;}