Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int f(int B[],int n,int &d)
- {
- int l = 1;int max=0;
- for (int i = 0; i<n-1; i++)
- {
- if (B[i] <B[i+1]){
- l++;
- if (max<=l){
- max=l; d=i+2-l;
- }
- }
- else{l=1;}
- }
- return max;
- }
- int main()
- {
- int Z[]={1,2,3,4,7,0,1,5,11,15,19,105,225,4,9,1};
- int d=0;
- cout<<f(Z,16,d)<<" "<<d;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement