Temperature Status


Submit solution

Points: 50 (partial)
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem types

題目說明

請撰寫一個 Java 程式,允許使用者輸入一個氣溫,並根據該氣溫輸出相應的天氣狀態。你將使用 Scanner 來讀取使用者輸入的數值。程式會根據以下條件來判斷天氣狀態:

如果氣溫高於等於 30 度,輸出 "Hot"。
如果氣溫在 20 到 29 度之間,輸出 "Warm"。
如果氣溫在 10 到 19 度之間,輸出 "Cool"。
如果氣溫在 0 到 9 度之間,輸出 "Cold"。
如果氣溫低於 0 度,輸出 "Freezing"。

輸入

使用者會輸入一個整數來表示氣溫。

輸出

輸出包含兩行:第一行輸出氣溫,第二行輸出對應的天氣狀態。

範例輸入

25

範例輸出

Temperature: 25
Status: Warm

Comments

There are no comments at the moment.