Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- int n,Number=0;
- bool yes=false;
- int A[10000];
- cin>>n;
- for (int i=0;i<n;i++)
- {
- cin>>A[i];
- }
- for (int i=1;i<n;i++)
- {
- if (A[i]>0 && A[i-1]>0 || A[i]<0 && A[i-1]<0 )
- yes=true;
- }
- if (yes) cout<<"YES";
- else cout<<"NO";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement