#include <stdio.h>
void cal(int x, int y, int *sum, int *diff, int *mul, int *mod);
int main(void) {
int x,y,sum,diff,mul,mod;
cal(x,y,&sum,&diff,&mul,&mod);
printf("sum=%d diff=%d mul=%d mod=%d",sum
,diff
,mul
,mod
); return 0;
}
void cal(int x, int y, int *sum, int *diff, int *mul, int *mod){
*sum=x+y;
if(x>=y) *diff=x-y;
else *diff=y-x;//x-yの絶対値
*mul=x*y;
*mod=x%y;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCk7CgppbnQgbWFpbih2b2lkKSB7CglpbnQgeCx5LHN1bSxkaWZmLG11bCxtb2Q7CglzY2FuZigiJWQiLCZ4KTsKCXNjYW5mKCIlZCIsJnkpOwoJY2FsKHgseSwmc3VtLCZkaWZmLCZtdWwsJm1vZCk7CglwcmludGYoInN1bT0lZCBkaWZmPSVkIG11bD0lZCBtb2Q9JWQiLHN1bSxkaWZmLG11bCxtb2QpOwoJcmV0dXJuIDA7Cn0KCnZvaWQgY2FsKGludCB4LCBpbnQgeSwgaW50ICpzdW0sIGludCAqZGlmZiwgaW50ICptdWwsIGludCAqbW9kKXsKCSpzdW09eCt5OwoJaWYoeD49eSkgKmRpZmY9eC15OwoJZWxzZSAqZGlmZj15LXg7Ly94LXnjga7ntbblr77lgKQKCSptdWw9eCp5OwoJKm1vZD14JXk7Cn0=