#include <stdio.h>
int main(void) {
int x=4;
int y=2;
int *sum;
int *diff;
int *mul;
int *mod;
cal(x,y,&sum,&diff,&mul,&mod);
printf("xとyの和は %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;
*mul = x * y;
if(x>y){
*diff = x - y;
*mod = x / y;
}else{
*diff = y - x;
*mod = x / y;
}
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CiBpbnQgeD00OwogaW50IHk9MjsKIGludCAqc3VtOwogaW50ICpkaWZmOwogaW50ICptdWw7CiBpbnQgKm1vZDsKIAogY2FsKHgseSwmc3VtLCZkaWZmLCZtdWwsJm1vZCk7CiAKIHByaW50ZigieOOBqHnjga7lkozjga8gJWQg44CB5beu44GvICVkIOOAgeepjeOBryAlZCDjgIHllYbjga8gJWQg44Gn44GZ44CCIixzdW0sZGlmZixtdWwsbW9kKTsKIHJldHVybiAwOwp9Cgp2b2lkIGNhbChpbnQgeCxpbnQgeSxpbnQgKnN1bSxpbnQgKmRpZmYsaW50ICptdWwsaW50ICptb2QpewogKnN1bSA9IHggKyB5OwogKm11bCA9IHggKiB5OwogaWYoeD55KXsKICAqZGlmZiA9IHggLSB5OwogICptb2QgPSB4IC8geTsKIH1lbHNlewogICpkaWZmID0geSAtIHg7CiAgKm1vZCA9IHggLyB5OwogfQp9