Advertisement
otot957

Untitled

Aug 5th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include<array>
  3. #include <bits/stdc++.h>
  4. #include<string>
  5. using namespace std;
  6. int main ()
  7.  
  8.  
  9.  
  10. {
  11.     int n=0,l,w=0,h=0,k=0;
  12.     cin>>n;
  13.     while(n!=0){
  14.             k++;
  15.             h=0;w=0;
  16.             for(int i=0;i<n;i++){
  17.  
  18.                 cin>>l;
  19.                 if(l==0)
  20.                     w++;
  21.                 else h++;
  22.  
  23.           }
  24.             cout<<"Case "<<k<<": "<<h-w<<endl;
  25.             cin>>n;
  26.     }
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement