Advertisement
Guest User

Untitled

a guest
May 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. #include <iostream>using
  2.  namespace std;
  3. int main()
  4. {
  5. int n,a=0,b=0,i,x;
  6. cin>>n;
  7. for (i=1;i<=n;i++)
  8.  {
  9. cin>>x;
  10.  if (x%2==1)
  11.  if (a==0)
  12.  a=x;
  13.  else
  14.  if (b==0)
  15.  b=x;
  16.  else
  17.  {
  18. a=b;
  19. b=x;
  20.  }
  21. }
  22. cout<<a<<" "<<b;
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement