daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.     int arrLength;
  8.     int temp;
  9.     int fmax = -2100000000, smax = -2100000000;
  10.  
  11.     cin >> arrLength;
  12.  
  13.     for (int i = 0; i < arrLength; i++) {
  14.         cin >> temp;
  15.  
  16.         if (temp > fmax)
  17.         {
  18.             smax = fmax;
  19.             fmax = temp;
  20.         }
  21.     }
  22.  
  23.     cout << smax << "\n";
  24.  
  25.  
  26.     return 0;
  27. }
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