Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n, neg = 0;
- cin >> n;
- vector<int> v(n);
- for (auto &i : v)
- {
- cin >> i;
- if (i == 0)
- {
- cout << "Not Positive and Not Negative" << endl;
- return;
- }
- else if (i < 0)
- {
- neg++;
- }
- }
- cout << (neg % 2 == 0 ? "Positive" : "Negative") << endl;
Advertisement
Add Comment
Please, Sign In to add comment