Advertisement
juanjo12x

UVA_12279_Emoogle_Balance

May 26th, 2014
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char** argv) {
  5.     int i,t,a,conte,conta,result,cont;
  6.     cont=0;
  7.     while(scanf("%d",&t)){
  8.         if(t==0) break;
  9.         conte=0;
  10.         conta=0;
  11.         for (i=0;i<t;i++){
  12.             scanf("%d",&a);
  13.             if (a==0) conte++;
  14.             if(a!=0) conta++;
  15.         }
  16.         result=conta-conte;
  17.         cont++;
  18.         printf("Case %d: %d\n",cont,result);
  19.     }
  20.     return (EXIT_SUCCESS);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement