daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <bits/stdc++.h>
  3.  
  4. using namespace std;
  5.  
  6. signed main()
  7. {
  8.     int n;
  9.  
  10.     cin >> n;
  11.  
  12.     int max, x, ind = 0;
  13.     cin >> max;
  14.  
  15.     for (int i = 1; i < n; i++)
  16.     {
  17.         cin >> x;
  18.  
  19.         if (max < x)
  20.         {
  21.             max = x;
  22.             ind = i;
  23.         }
  24.     }
  25.  
  26.     cout << ind << endl;
  27.  
  28.     return 0;
  29. }
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