#include <stdio.h>
// 計算を行う関数 cal の定義
void cal(int x, int y, int *sum, int *diff, int *mul, int *mod) {
// 和の計算
*sum = x + y;
// 差の計算(常に正の整数にする)
*diff = (x > y) ? (x - y) : (y - x);
// 積の計算
*mul = x * y;
// 商の計算(小数点以下を切り捨て)
*mod = x / y;
}
int main() {
// 6つの整数変数を定義
int x, y, sum, diff, mul, mod;
// ユーザーから x と y の入力を取得
// cal 関数を呼び出し、各計算結果を格納
cal(x, y, &sum, &diff, &mul, &mod);
// 計算結果を表示
printf("|x - y| = %d\n", diff
);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgovLyDoqIjnrpfjgpLooYzjgYbplqLmlbAgY2FsIOOBruWumue+qQp2b2lkIGNhbChpbnQgeCwgaW50IHksIGludCAqc3VtLCBpbnQgKmRpZmYsIGludCAqbXVsLCBpbnQgKm1vZCkgewogICAgLy8g5ZKM44Gu6KiI566XCiAgICAqc3VtID0geCArIHk7CiAgICAvLyDlt67jga7oqIjnrpfvvIjluLjjgavmraPjga7mlbTmlbDjgavjgZnjgovvvIkKICAgICpkaWZmID0gKHggPiB5KSA/ICh4IC0geSkgOiAoeSAtIHgpOwogICAgLy8g56mN44Gu6KiI566XCiAgICAqbXVsID0geCAqIHk7CiAgICAvLyDllYbjga7oqIjnrpfvvIjlsI/mlbDngrnku6XkuIvjgpLliIfjgormjajjgabvvIkKICAgICptb2QgPSB4IC8geTsKfQoKaW50IG1haW4oKSB7CiAgICAvLyA244Gk44Gu5pW05pWw5aSJ5pWw44KS5a6a576pCiAgICBpbnQgeCwgeSwgc3VtLCBkaWZmLCBtdWwsIG1vZDsKCiAgICAvLyDjg6bjg7zjgrbjg7zjgYvjgokgeCDjgaggeSDjga7lhaXlipvjgpLlj5blvpcKICAgIHByaW50Zigi5pW05pWwIHgg44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GEOiAiKTsKICAgIHNjYW5mKCIlZCIsICZ4KTsKICAgIHByaW50Zigi5pW05pWwIHkg44KS5YWl5Yqb44GX44Gm44GP44Gg44GV44GEOiAiKTsKICAgIHNjYW5mKCIlZCIsICZ5KTsKCiAgICAvLyBjYWwg6Zai5pWw44KS5ZG844Gz5Ye644GX44CB5ZCE6KiI566X57WQ5p6c44KS5qC857SNCiAgICBjYWwoeCwgeSwgJnN1bSwgJmRpZmYsICZtdWwsICZtb2QpOwoKICAgIC8vIOioiOeul+e1kOaenOOCkuihqOekugogICAgcHJpbnRmKCJ4ICsgeSA9ICVkXG4iLCBzdW0pOwogICAgcHJpbnRmKCJ8eCAtIHl8ID0gJWRcbiIsIGRpZmYpOwogICAgcHJpbnRmKCJ4ICogeSA9ICVkXG4iLCBtdWwpOwogICAgcHJpbnRmKCJ4IC8geSA9ICVkXG4iLCBtb2QpOwoKICAgIHJldHVybiAwOwp9Cg==