Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long long int a, mx1, mx2;
- int main()
- {
- cin >> a;
- while (a != 0)
- {
- if (a >= mx1)
- {
- mx2 = mx1;
- mx1 = a;
- }
- else if (a > mx2 && a != mx1)
- mx2 = a;
- cin >> a;
- }
- cout << mx2;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement