#include <stdio.h>
int main() {
int N, X, Y;
printf("請輸入 N、X、Y (0 < Y): "); scanf("%d %d %d", &N
, &X
, &Y
);
int temperature = 20;
if (N % 2 == 0) {
N -= 1; // 如果N是偶數,減1使其變成奇數,然後執行一次冷卻操作
temperature -= Y;
if (temperature < 20) {
temperature = 20;
}
}
// 使用循環計算最高溫度
for (int i = 1; i < N / 2; i++) {
temperature += X;
temperature -= Y;
if (temperature < 20) {
temperature = 20;
}
}
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbigpIHsKICAgIGludCBOLCBYLCBZOwogICAgcHJpbnRmKCLoq4vovLjlhaUgTuOAgVjjgIFZICgwIDwgWSk6ICIpOwogICAgc2NhbmYoIiVkICVkICVkIiwgJk4sICZYLCAmWSk7CgogICAgaW50IHRlbXBlcmF0dXJlID0gMjA7CgogICAgaWYgKE4gJSAyID09IDApIHsKICAgICAgICBOIC09IDE7IC8vIOWmguaenE7mmK/lgbbmlbjvvIzmuJsx5L2/5YW26K6K5oiQ5aWH5pW477yM54S25b6M5Z+36KGM5LiA5qyh5Ya35Y275pON5L2cCiAgICAgICAgdGVtcGVyYXR1cmUgLT0gWTsKICAgICAgICBpZiAodGVtcGVyYXR1cmUgPCAyMCkgewogICAgICAgICAgICB0ZW1wZXJhdHVyZSA9IDIwOwogICAgICAgIH0KICAgIH0KCiAgICAvLyDkvb/nlKjlvqrnkrDoqIjnrpfmnIDpq5jmuqvluqYKICAgIGZvciAoaW50IGkgPSAxOyBpIDwgTiAvIDI7IGkrKykgewogICAgICAgIHRlbXBlcmF0dXJlICs9IFg7CiAgICAgICAgdGVtcGVyYXR1cmUgLT0gWTsKICAgICAgICBpZiAodGVtcGVyYXR1cmUgPCAyMCkgewogICAgICAgICAgICB0ZW1wZXJhdHVyZSA9IDIwOwogICAgICAgIH0KICAgIH0KCiAgICBwcmludGYoIiVkXG4iLCB0ZW1wZXJhdHVyZSk7CgogICAgcmV0dXJuIDA7Cn0K