#include <cstdio>
int a[20];
int b[20];
int main()
{
int n;
int c = 0;
while(scanf("%d", &n)==1&&n)
{
if(c!=0)
putchar('\n');
c++;
for(int i=0; i<n; i++)
scanf("%d", &a[i]);
for(int i=0; i<n; i++)
scanf("%d", &b[i]);
int aa = 0, bb = 0;
for(int i=0; i<n; i++)
{
if(a[i]==1&&b[i]==2)
{
aa+=6;
}
else if(a[i]==2&&b[i]==1)
{
bb+=6;
}
else if(a[i]>b[i])
{
if(a[i]-b[i]==1)
bb+=(a[i]+b[i]);
else
aa+=a[i];
}
else if(a[i]<b[i])
{
if(b[i]-a[i]==1)
aa+=(a[i]+b[i]);
else
bb+=b[i];
}
}
printf("A has %d points. B has %d points.\n", aa, bb);
}
return 0;
}
1087(水)
最新推荐文章于 2018-08-08 15:28:36 发布