Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main()
- {
- int n=1, maxx1=0, maxx2=0;
- cin>>n;
- while(n!=0)
- {
- cin>> n;
- if(n>maxx1)
- {
- maxx2=maxx1;
- maxx1=n;
- }
- }
- if(maxx2!=0)
- cout << maxx2;
- else
- cout<< maxx1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement