Advertisement
Josif_tepe

Untitled

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