Advertisement
Sunt_tare

pb1_20102018

Oct 20th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n , V[105] , i , OK , OK1;
  8.     cin >> n;
  9.     OK1 = 0;
  10.     for(i=1;i<=n;i++)
  11.     {
  12.         cin >> V[i];
  13.         OK = 0;
  14.         if(i>=2)
  15.         {
  16.             if(V[i]>=0&&V[i-1]<=0)
  17.                 OK = 1;
  18.             if(V[i]<=0&&V[i-1]>=0)
  19.                 OK = 1;
  20.         }
  21.         if(OK==0&&i>=2){
  22.             OK1 = 1;
  23.         }
  24.     }
  25.     if(OK1==1)
  26.         cout << "Nu";
  27.     else
  28.         cout << "Da";
  29.     return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement