12279 -
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a,x,y;
int c=1;
while(scanf("%d",&n)&&n)
{
x=y=0;
while(n--)
{
cin>>a;
if(a==0)
x++;
else y++;
}
printf("Case %d: %d\n",c,y-x);
c++;
}
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,a,x,y;
int c=1;
while(scanf("%d",&n)&&n)
{
x=y=0;
while(n--)
{
cin>>a;
if(a==0)
x++;
else y++;
}
printf("Case %d: %d\n",c,y-x);
c++;
}
return 0;
}
0 comments :
Post a Comment