Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- #include <string>
- #include <algorithm>
- #include <vector>
- using namespace std;
- int main()
- {
- long long good, sc=0, maxsc=0, n, promcor, num=1, answer;
- cin >> n;
- cin >> good;
- for (int a = 2; a <= n; a++)
- {
- cin >> promcor;
- if (promcor < good)
- {
- sc++;
- good = promcor;
- if (maxsc <= sc)
- {
- maxsc = sc;
- answer = num;
- }
- sc = 0;
- num = a;
- }
- else
- sc++;
- }
- if (maxsc <= sc)
- {
- maxsc = sc;
- answer = num;
- }
- cout << answer;
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment