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