#include <stdio.h>
#include <stdlib.h> // abs関数を使うために必要
// 計算を行う関数 cal の定義
void cal(int x, int y, int *sum, int *diff, int *mul, int *mod) {
*sum = x + y; // 和
*diff
= abs(x
- y
); // 差(絶対値) *mul = x * y; // 積
*mod = x / y; // 商(小数点以下を切り捨て)
}
int main() {
int x, y;
int sum, diff, mul, mod;
// ユーザーからxとyの入力を受け取る
// 関数 cal を呼び出し、結果をポインタ経由で格納
cal(x, y, &sum, &diff, &mul, &mod);
// 結果を表示
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4gIC8vIGFic+mWouaVsOOCkuS9v+OBhuOBn+OCgeOBq+W/heimgQoKLy8g6KiI566X44KS6KGM44GG6Zai5pWwIGNhbCDjga7lrprnvqkKdm9pZCBjYWwoaW50IHgsIGludCB5LCBpbnQgKnN1bSwgaW50ICpkaWZmLCBpbnQgKm11bCwgaW50ICptb2QpIHsKICAgICpzdW0gPSB4ICsgeTsgICAgICAgICAgICAgIC8vIOWSjAogICAgKmRpZmYgPSBhYnMoeCAtIHkpOyAgICAgICAgLy8g5beu77yI57W25a++5YCk77yJCiAgICAqbXVsID0geCAqIHk7ICAgICAgICAgICAgICAvLyDnqY0KICAgICptb2QgPSB4IC8geTsgICAgICAgICAgICAgIC8vIOWVhu+8iOWwj+aVsOeCueS7peS4i+OCkuWIh+OCiuaNqOOBpu+8iQp9CgppbnQgbWFpbigpIHsKICAgIGludCB4LCB5OwogICAgaW50IHN1bSwgZGlmZiwgbXVsLCBtb2Q7CgogICAgLy8g44Om44O844K244O844GL44KJeOOBqHnjga7lhaXlipvjgpLlj5fjgZHlj5bjgosKICAgIHByaW50Zigi5pW05pWweOOCkuWFpeWKm+OBl+OBpuOBj+OBoOOBleOBhDogIik7CiAgICBzY2FuZigiJWQiLCAmeCk7CiAgICBwcmludGYoIuaVtOaVsHnjgpLlhaXlipvjgZfjgabjgY/jgaDjgZXjgYQ6ICIpOwogICAgc2NhbmYoIiVkIiwgJnkpOwoKICAgIC8vIOmWouaVsCBjYWwg44KS5ZG844Gz5Ye644GX44CB57WQ5p6c44KS44Od44Kk44Oz44K/57WM55Sx44Gn5qC857SNCiAgICBjYWwoeCwgeSwgJnN1bSwgJmRpZmYsICZtdWwsICZtb2QpOwoKICAgIC8vIOe1kOaenOOCkuihqOekugogICAgcHJpbnRmKCLlkow6ICVkXG4iLCBzdW0pOwogICAgcHJpbnRmKCLlt646ICVkXG4iLCBkaWZmKTsKICAgIHByaW50Zigi56mNOiAlZFxuIiwgbXVsKTsKICAgIHByaW50Zigi5ZWGOiAlZFxuIiwgbW9kKTsKCiAgICByZXR1cm4gMDsKfQ==