出かける前に天気を確認します。降水確率(0〜100)が 50 以上なら傘を持っていきます。必要なら true、いらなければ false を返す need_umbrella(rain_chance) を書きましょう。
need_umbrella(80)→Trueneed_umbrella(10)→Falsebool need_umbrella(int rain_chance)#include <stdbool.h>
bool need_umbrella(int rain_chance) {
// ここにコードを書く:確率が 50 以上なら true を返す
return false;
}
実行すると例で試せます。よさそうなら提出しましょう。