#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;
x=2;
y=7;
cal(x, y, &sum, &diff, &mul, &mod);
printf("和:%d 差:%d 積:%d 商:%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;
if(*diff<0){
*diff=*diff*-1;
}
*mul=x*y;
*mod=x/y;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCk7CnZvaWQgYWJzKGludCBiKTsKaW50IG1haW4odm9pZCkgewoJaW50IHgseSxzdW0sZGlmZixtdWwsbW9kOwogICB4PTI7CiAgIHk9NzsKCgljYWwoeCwgeSwgJnN1bSwgJmRpZmYsICZtdWwsICZtb2QpOwoJcHJpbnRmKCLlkow6JWQg5beuOiVkIOepjTolZCDllYY6JWQiLHN1bSxkaWZmLG11bCxtb2QpOwoJcmV0dXJuIDA7Cn0KICB2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCl7CiAJKnN1bT14K3k7CiAJKmRpZmY9eC15OwogCWlmKCpkaWZmPDApewogCQkqZGlmZj0qZGlmZiotMTsKIAl9CiAJKm11bD14Knk7CiAJKm1vZD14L3k7CiB9CiA=