#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; // 積
*mod = x / y; // 商(整数同士の割り算 → 小数点以下は自動で切り捨て)
}
int main(void)
{
int x, y;
int sum, diff, mul, mod;
cal(x, y, &sum, &diff, &mul, &mod);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+Cgp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCkKewogICAgKnN1bSA9IHggKyB5OyAgICAgICAgICAgICAgLy8g5ZKMCgogICAgLy8g5beu44Gv5b+F44Ga5q2j44Gu5pW05pWw77yI57W25a++5YCk77yJCiAgICBpZiAoeCA+PSB5KSB7CiAgICAgICAgKmRpZmYgPSB4IC0geTsKICAgIH0gZWxzZSB7CiAgICAgICAgKmRpZmYgPSB5IC0geDsKICAgIH0KCiAgICAqbXVsID0geCAqIHk7ICAgICAgICAgICAgICAvLyDnqY0KCiAgICAqbW9kID0geCAvIHk7ICAgICAgICAgICAgICAvLyDllYbvvIjmlbTmlbDlkIzlo6vjga7libLjgornrpcg4oaSIOWwj+aVsOeCueS7peS4i+OBr+iHquWLleOBp+WIh+OCiuaNqOOBpu+8iQp9CgppbnQgbWFpbih2b2lkKQp7CiAgICBpbnQgeCwgeTsKICAgIGludCBzdW0sIGRpZmYsIG11bCwgbW9kOwoKICAgIHByaW50ZigieCDjgaggeSDjgpLlhaXlipvjgZfjgabjgY/jgaDjgZXjgYQ6ICIpOwogICAgc2NhbmYoIiVkICVkIiwgJngsICZ5KTsKCiAgICBjYWwoeCwgeSwgJnN1bSwgJmRpZmYsICZtdWwsICZtb2QpOwoKICAgIHByaW50Zigic3VtICA9ICVkXG4iLCBzdW0pOwogICAgcHJpbnRmKCJkaWZmID0gJWRcbiIsIGRpZmYpOwogICAgcHJpbnRmKCJtdWwgID0gJWRcbiIsIG11bCk7CiAgICBwcmludGYoIm1vZCAgPSAlZFxuIiwgbW9kKTsKCiAgICByZXR1cm4gMDsKfQ==