Advertisement
Diene

Untitled

Feb 27th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3. int main(){
  4.  
  5. int n;
  6.  
  7. while(n!=0){
  8.  
  9.     scanf("%d", &n);
  10.  
  11.     int A=0, B=0;
  12.  
  13.     for(int i=0; i<n; i++){
  14.  
  15.     int a, b;
  16.  
  17.     scanf("%d %d", &a, &b);
  18.  
  19.     if(a>b){A++;}
  20.  
  21.     else if(a<b){B++;}
  22.  
  23.     else if (a==b){A==A, B==B;}
  24.  
  25.     }
  26.  
  27.     if(n!=0){printf("%d %d", A, B);}
  28.  
  29. }
  30.  
  31. return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement