Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int m1,m2 = 0, x ;
  6. cin>>m1;
  7. do {
  8. cin >> x;
  9. if (x > m1){m2=m1; m1 = x; }
  10. else if (x > m2)m2 = x;
  11. }
  12. while (x);
  13. cout << m2;
  14. return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement