Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int i,v[50],n,monoton(1);
- int main()
- {
- cin>>n;
- for(i=1;i<=n;i++)
- cin>>v[i];
- for(i=1;i<=n-2&&monoton;i++)
- if((v[i]-v[i-1])*(v[i+1]-v[i])<=0) //!!!!!!! nu e mono
- monoton=0;
- if(monoton) if(v[1]-v[0]>0) cout<<"Sirul strict monoton crescator"<<endl;
- else cout<<"Sirul strict monoton descrescator"<<endl;
- else cout<<"Sirul nu este monoton"<<endl;
- return 1337;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement