#include <stdio.h>
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;
}
}
int main(){
int x,y;
int sum,diff, mul, mod;
cal(x,y,&sum,&diff,&mul,&mod);
printf("課題1\nx+y=%d\n|x-y|=%d\nx*y=%d\nx/y=%d",sum
,diff
,mul
,mod
); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCl7Cgkqc3VtPXgreTsKCWlmKHg+eSl7CgkJKmRpZmY9eC15OwoJfQoJZWxzZXsKCQkqZGlmZj15LXg7Cgl9CgkqbXVsPXgqeTsKCWlmKHkhPTApewoJCSptb2Q9eC95OwoJfQp9CgoKaW50IG1haW4oKXsKCWludCB4LHk7CglpbnQgc3VtLGRpZmYsIG11bCwgbW9kOwoJc2NhbmYoIiVkICVkIiwmeCwmeSk7CgljYWwoeCx5LCZzdW0sJmRpZmYsJm11bCwmbW9kKTsKCXByaW50Zigi6Kqy6aGM77yRXG54K3k9JWRcbnx4LXl8PSVkXG54Knk9JWRcbngveT0lZCIsc3VtLGRpZmYsbXVsLG1vZCk7CglyZXR1cm4gMDsKfQ==