#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 \n", sum
, diff
, mul
, mod
);
return 0;
}
void cal (int x, int y, int*sum, int *diff, int*mul, int*mod)
{
*sum = x + y;
*diff = x - y;
if(x < y)
{ *diff = -(x - y); }
*mul = x * y;
*mod = x / y;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbCAoaW50IHgsIGludCB5LCBpbnQqc3VtLCBpbnQgKmRpZmYsIGludCptdWwsIGludCptb2QpOwoKaW50IG1haW4odm9pZCkgCnsKICAgIGludCB4LCB5LCBzdW0sIGRpZmYsIG11bCwgbW9kOwogICAgCiAgICBzY2FuZigiJWQiLCAmeCk7IHNjYW5mKCIlZCIsICZ5KTsKCXByaW50ZigieCA6ICVkICIseCk7ICBwcmludGYoInkgOiAlZCAiLHkpOyAKCQoJY2FsKHgsIHksICZzdW0sICZkaWZmLCAmbXVsLCAmbW9kKTsKICAgIAogICAgcHJpbnRmKCJzdW06JWQgZGlmZjolZCBtdWw6JWQgbW9kOiVkIFxuIiwgc3VtLCBkaWZmLCBtdWwsIG1vZCk7CiAgICAKCXJldHVybiAwOwp9Cgp2b2lkIGNhbCAoaW50IHgsIGludCB5LCBpbnQqc3VtLCBpbnQgKmRpZmYsIGludCptdWwsIGludCptb2QpCnsKICAJKnN1bSAgPSB4ICsgeTsKCSpkaWZmID0geCAtIHk7CgkgIGlmKHggPCB5KQogIHsgKmRpZmYgPSAtKHggLSB5KTsgfQoJKm11bCAgPSB4ICogeTsKCSptb2QgID0geCAvIHk7Cn0=