vitormartinotti

Untitled

Apr 4th, 2024
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. int main() {
  4.  
  5.     int teste = 1;
  6.    
  7.     while(true){
  8.         int n; scanf("%d", &n);
  9.         if(n == 0) break;
  10.        
  11.         printf("Teste %d\n", teste);
  12.        
  13.         int cofreJ = 0, cofreZ = 0;
  14.         for(int i = 1; i <= n; i++){
  15.             int J, Z;
  16.             scanf("%d %d", &J, &Z);
  17.             cofreJ = cofreJ + J;
  18.             cofreZ = cofreZ + Z;
  19.             printf("%d\n", cofreJ - cofreZ);
  20.         }
  21.        
  22.         teste++;
  23.         printf("\n");
  24.     }
  25.  
  26.  
  27.  
  28.  
  29.  
  30.     return 0;
  31. }
  32.  
Add Comment
Please, Sign In to add comment