输入

# include<stdio.h>
int main()

{
int j,i,h,N,count1=0,count2,a[1000],b[1000];
scanf("%d",&N);
for(h=0;h<N;h++)
{
for(i=0;i<N;i++)
{
scanf("%d",&a[i]);//alice
}
for(j=0;j<N;j++)
{
scanf("%d",&b[j]);
}
if(a[i]>b[j])
{
count1=count1+1;
}

}

以上是错误的输入

以下是正确的输入

# include<stdio.h>
int main()

{
int j,i,h,N,count1=0,count2,a[1000],b[1000];
scanf("%d",&N);
for(h=0;h<N;h++)
{

scanf("%d",&a[h]);//alice

scanf("%d",&b[h]);

if(a[h]>b[h])
{
count1=count1+1;
}

}
count2=N-count1;
if(count1>count2)
printf("Alice %d",count1);
else
printf("Bob %d",count2);
return 0;

}

输入格式

5

1 2 3 4 5

5 4 3 2 1

原文地址:https://www.cnblogs.com/wshyj/p/5989027.html