Advertisement
SergeyPGUTI

5.2.5

Oct 3rd, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int n,Number=0;
  9.     bool yes=false;
  10.     int A[10000];
  11.     cin>>n;
  12.     for (int i=0;i<n;i++)
  13.     {
  14.         cin>>A[i];
  15.     }
  16.     for (int i=1;i<n;i++)
  17.     {
  18.         if (A[i]>0 && A[i-1]>0 || A[i]<0 && A[i-1]<0 )
  19.             yes=true;
  20.     }
  21.     if (yes) cout<<"YES";
  22.         else cout<<"NO";
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement