#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("x = %d, y = %d\n", x
, y
);
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;
*mul = x * y;
if (y != 0)
*mod = x / y;
else
*mod = 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCxpbnQgeSxpbnQgKnN1bSxpbnQgKmRpZmYsaW50ICptdWwsaW50ICptb2QpOwoKaW50IG1haW4odm9pZCkgCnsKCWludCB4LCB5LCBzdW0sIGRpZmYsIG11bCwgbW9kOwoKICAgIAogICAgc2NhbmYoIiVkIiwgJngpOwogICAgc2NhbmYoIiVkIiwgJnkpOwoKICAgIGNhbCh4LCB5LCAmc3VtLCAmZGlmZiwgJm11bCwgJm1vZCk7CgoJcHJpbnRmKCJ4ID0gJWQsIHkgPSAlZFxuIiwgeCwgeSk7CiAgICBwcmludGYoInN1bSA9ICVkXG4iLCBzdW0pOwogICAgcHJpbnRmKCJkaWZmID0gJWRcbiIsIGRpZmYpOwogICAgcHJpbnRmKCJtdWwgPSAlZFxuIiwgbXVsKTsKICAgIHByaW50ZigibW9kID0gJWRcbiIsIG1vZCk7CiAgICAKCXJldHVybiAwOwp9Cgogdm9pZCBjYWwoaW50IHgsaW50IHksaW50ICpzdW0saW50ICpkaWZmLGludCAqbXVsLGludCAqbW9kKQogewogCSpzdW0gPSB4ICsgeTsKIAlpZiAoeCA+IHkpCiAgICAgICAqZGlmZiA9IHggLSB5OwogICAgZWxzZQogICAgICAgKmRpZmYgPSB5IC0geDsKCiAgICAqbXVsID0geCAqIHk7CgogICAgaWYgKHkgIT0gMCkKICAgICAgKm1vZCA9IHggLyB5OwogICAgZWxzZQogICAgICAgKm1vZCA9IDA7IAoJCn0=