//C code starts
#define mod(a) (a>=0?a:-a)
#include<stdio.h>
int main(){
int x,y,z;
scanf("%d%d%d",&x,&y,&z);
printf("%d %d %d %d %d
",x,y,z,y-z,x-z);
if(mod(y-x)<mod(x-z)) printf("%d %d Cat A",mod(y-z),mod(x-z));
else if(mod(y-z)>mod(x-z)) printf("%d %d Cat B",mod(y-z),mod(x-z));
else printf("Mouse C");
printf("
");
}
/*code ends here*/
For the input of "1 3 2" I would expect the output to be "Mouse C" but it is not the case.
Also if we add all the variables in mod in one more bracket (e.g. if the mod(y-z)
is then written as mod((y-z))
) then the output comes as expected.
So why it is going on?