daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Jan 19th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6. int n=1, maxx1=0, maxx2=0;
  7. cin>>n;
  8. while(n!=0)
  9. {
  10.     cin>> n;
  11.     if(n>maxx1)
  12.     {
  13.         maxx2=maxx1;
  14.         maxx1=n;
  15.     }
  16. }
  17. if(maxx2!=0)
  18. cout << maxx2;
  19. else
  20.     cout<< maxx1;
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top