the lead game:what is wrong in it???

#include<stdio.h>
#include<stdlib.h>
int a[10000+1],b[10000+1];
int main()
{
int n,i,max1=0,max2=0,sum1=0,sum2=0;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d %d",&a[i],&b[i]);
if(a[i]>b[i])
{
sum1=a[i]-b[i];
if(sum1>max1)
max1=sum1;
}
else
{
sum2=b[i]-a[i];
if(sum2>max2)
max2=sum2;
}
}
if(max1>max2)
printf(“1 %d\n”,max1);
else
printf(“2 %d\n”,max2);
return(0);
}

2 Likes

this is not right code.

this code is right it has no error.

//