#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 def:%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;
*diff = x-y;
*mul = x*y;
*mod = x/y;
if(*diff<0){
*diff = -*diff;
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCxpbnQgeSxpbnQgKnN1bSxpbnQgKmRpZmYsaW50ICptdWwsaW50ICptb2QpOwoKaW50IG1haW4odm9pZCkgewoJaW50IHgseSxzdW0sZGlmZixtdWwsbW9kOwoJCglzY2FuZigiJWQiLCZ4KTtwcmludGYoInggOiVkXG4iLHgpOwoJc2NhbmYoIiVkIiwmeSk7cHJpbnRmKCJ5IDolZFxuIix5KTsKCQoJY2FsKHgseSwmc3VtLCZkaWZmLCZtdWwsJm1vZCk7CgkKCXByaW50Zigic3VtOiVkIGRlZjolZCBtdWw6JWQgbW9kOiVkIixzdW0sZGlmZixtdWwsbW9kKTsKCQoJcmV0dXJuIDA7Cn0KCnZvaWQgY2FsKGludCB4LGludCB5LGludCAqc3VtLGludCAqZGlmZixpbnQgKm11bCxpbnQgKm1vZCl7Cgkqc3VtID0geCt5OwoJKmRpZmYgPSB4LXk7CgkqbXVsID0geCp5OwoJKm1vZCA9IHgveTsKCWlmKCpkaWZmPDApewoJCSpkaWZmID0gLSpkaWZmOwoJfQp9