|
|
вернуться в форумTest 25? Help please. I can't understand what's wrong? #include <iostream> using namespace std; int main() { int n,s=1,max,j,i; cin>>n; int *a=new int[n]; for(i=0; i<n;i++) cin>>a[i]; s=1;max=0; for(i=0;i<n;i++) { j=i+1; while(a[i]<a[j]) j++; if (j-i>=s) { if (max>0) s=j-i+1; else s=j-i; max=i; } }; cout<<max+1;
delete a; return 0; } Edited by author 07.02.2013 01:30 |
|
|