5% error in C

Lucas Dias asked 7 months ago


int main(void){ int x1, x2, y1, y2; while ((x1!=0)&&(y1!=0)&&(x2!=0)&&(y2!=0)){ scanf("%d%d%d%d", &x1, &y1, &x2, &y2); if((x1==x2) && (y1==y2)){ printf("0\n"); } else if(x1==x2 || y1==y2){ printf("1\n"); } else if (((x1+y1)==(x2+y2)) || ((x1+x2)==(y1+y2))){ printf("1\n"); } else printf("2\n"); } return 0; }

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

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