Advertisement
CristinaGeorgiu

488

Jan 22nd, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement