Advertisement
yejolga

ol_4_09

Nov 1st, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9.     ifstream cin("input.txt");
  10.     short n;
  11.     cin>>n;
  12.  
  13.     long pre = 0;
  14.     short i;
  15.     for(i = 0; i < n; i++)
  16.     {
  17.         long cur;
  18.         cin>>cur;
  19.         if (cur <= pre)
  20.             break;
  21.         pre=cur;
  22.     }
  23.     cout<<i;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement