#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("add:%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 = (-1)*(x - y);
}
*mul = x*y;
*mod = x/y;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCk7CgppbnQgbWFpbih2b2lkKSB7CglpbnQgeCwgeSwgc3VtLCBkaWZmLCBtdWwsIG1vZDsKCXNjYW5mKCIlZCIsICZ4KTsKCXNjYW5mKCIlZCIsICZ5KTsKCXByaW50ZigieDolZCAiLCB4KTsKCXByaW50ZigieTolZCAiLCB5KTsgCgkKCWNhbCh4LCB5LCAmc3VtLCAmZGlmZiwgJm11bCwgJm1vZCk7CgkKCXByaW50ZigiYWRkOiVkIGRpZmY6JWQgbXVsOiVkIG1vZDolZCIsIHN1bSwgZGlmZiwgbXVsLCBtb2QpOwoJcmV0dXJuIDA7Cn0KIAp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCkgewoJKnN1bSA9IHggKyB5OwoJaWYoeCA+IHkpewoJCSpkaWZmID0geCAtIHk7Cgl9CgllbHNlewoJCSpkaWZmID0gKC0xKSooeCAtIHkpOwoJfQoJKm11bCA9IHgqeTsKCSptb2QgPSB4L3k7CgkKfQo=