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