去年中山大学acm校赛A题(第一题)这段代码有什么问题?
# include <stdio.h>
int main()
{
int A,B,C,T,i,j;
int a[4]={0,0,0,0};
C=-1;
scanf("%d",&T);
for(i=1;i<=T;i++)
{
scanf("%d %d",&A,&B);
if ((A ==0 && B == 0) || A + B == 1e6)
C = 0;
else {
for(j=1;j<=3;j++)
{
a[j]=j*1e6-A-B;
if (a[j] < 0 || a[i] > 1e6)
a[j] = -1;
else
C =a[j];
}
}
printf("%d\n",C); }
return 0;
} 
查看5道真题和解析