Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <cmath>
- #include <math.h>
- using namespace std;
- int massive[100];
- int d;
- int positive = 0;
- int main(int argc, const char * argv[]) {
- cin >> d;
- for(int i = 1; i <= d; i++){
- cin >> massive[i];
- }
- for(int i = 1; i < d; i++){
- if(massive[i] >= 0 && massive[i+1] >= 0){
- positive = positive + 1;
- }
- if(massive[i] <= 0 && massive[i+1] <= 0){
- positive = positive + 1;
- }
- }
- if(positive > 0){
- cout << "YES";
- }
- else {
- cout << "NO";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement