josiftepe

Untitled

Oct 25th, 2020
60
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 z;
  8.    cin>> z;
  9.  
  10.    int x;
  11.  
  12.    int m;
  13.    int z1;
  14.    int m2=0;
  15.    int z2=0;
  16.  
  17.    while(z>0){
  18.     z-=1;
  19.      x+=1;
  20.       cin>>z1;
  21.        cin>>m;
  22.         z2+=z1;
  23.          m2+=m;
  24.    }
  25.     // z2 = 8
  26.     // m2 = 8
  27.      if(z2>m2){
  28.         cout<<"zelka" << endl;
  29.          cout << z2 << endl;
  30.      }
  31.     else if ((m2>=z2) or (m2==z2)){
  32.         cout<<"morkov" << endl;
  33.         cout << m2 << endl;
  34.       }
  35.  
  36.     return 0;
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment