Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. long long int a, mx1, mx2;
  5. int main()
  6. {
  7. cin >> a;
  8. while (a != 0)
  9. {
  10. if (a >= mx1)
  11. {
  12. mx2 = mx1;
  13. mx1 = a;
  14. }
  15. else if (a > mx2 && a != mx1)
  16. mx2 = a;
  17. cin >> a;
  18. }
  19. cout << mx2;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement