Kodewick
开始学 →
基础←→0 / 70

冷还是热

#014基础条件约 4 分钟

天气小卡片只写一个词:低于 10 度是 "cold",25 度和以上是 "hot",中间的是 "mild"。写 weather_word(temp) 返回这个词。

示例
weather_word(5)→'cold'
weather_word(18)→'mild'
weather_word(30)→'hot'
函数const char *weather_word(int temp)
main.c
const char *weather_word(int temp) {
    // 在这里写:低于 10 返回 "cold",25 和以上返回 "hot"
    return "mild";
}
Ctrl + Enter 也能运行
结果

写好了先点「运行」试试示例,没问题再点「提交」。