TOPIC

15% DE WA... Não sei o que está errado

Josimar Rachetti asked 1 year ago

segue o codigo

int main(){

int a,b,i,j,bbx,bby,bx,by,l; float l1,l2;

scanf("%i",&a);

for(i=0;i<a;i++){ scanf("%i",&b); scanf("%i %i",&bbx,&bby); scanf("%i %i",&bx,&by); l2=(bx+by)-(bbx+bby); l=1;

for(j=2;j<=b;j++){ scanf("%i %i",&bx,&by); l1=(bx+by)-(bbx+bby); if(0>l1){l1=l1*-1;} if((l2+0.01)>=l1){l2=l1;l=j;} }

printf("%i\n",l); }

return 0;}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.