Advertisement
a53

calcParImpar

a53
Dec 16th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int n;
  7. cin>>n;
  8. int x,Max=0,Min=1000000000;
  9. for(int i=1;i<=n;++i)
  10. {
  11. cin>>x;
  12. if(i%2==0&&x>Max)
  13. Max=x;
  14. if(i%2&&x>9&&x<100&&x<Min)
  15. Min=x;
  16. }
  17. cout<<Max<<' ';
  18. if(Min==1000000000)
  19. cout<<-1;
  20. else
  21. cout<<Min;
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement