Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int P, NP, IP, INP, N, A;
- int main()
- {
- cin>>N;
- while(N--)
- {
- cin>>A;
- if(A%2==1)
- {
- INP++;
- NP=A;
- }
- else
- {
- IP++;
- P=A;
- }
- }
- if(INP==1)
- cout<<NP;
- else
- cout<<P;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement