Advertisement
Josif_tepe

Untitled

Mar 13th, 2023
889
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int n;
  5.     cin >> n;
  6.    
  7.     int i = 1;
  8.     int pozitivini = 0;
  9.     int negativni = 0;
  10.     while(i <= n) {
  11.         int broj;
  12.         cin >> broj;
  13.        
  14.         if(broj > 0) {
  15.             pozitivini++;
  16.         }
  17.         else {
  18.             negativni++;
  19.         }
  20.        
  21.         i++;
  22.     }
  23.     cout << pozitivini << endl;
  24.     cout << negativni << endl;
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement