vitormartinotti

Untitled

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