HDU 2004 成績轉換

2022-08-02 11:36:09 字數 455 閱讀 2034

problem description

輸入乙個百分制的成績t,將其轉換成對應的等級,具體轉換規則如下:

90~100為a;

80~89為b;

70~79為c;

60~69為d;

0~59為e;

input

輸入資料有多組,每組佔一行,由乙個整數組成。

output

對於每組輸入資料,輸出一行。如果輸入資料不在0~100範圍內,請輸出一行:「score is error!」。

sample input

5667

100123

sample outputed

ascore is error!

**:

#include using namespace std;

int main()

}return 0;

}

hdu2004成績轉換

problem description 輸入乙個百分制的成績t,將其轉換成對應的等級,具體轉換規則如下 90 100為a 80 89為b 70 79為c 60 69為d 0 59為e input 輸入資料有多組,每組佔一行,由乙個整數組成。output 對於每組輸入資料,輸出一行。如果輸入資料不在0...

hdu 2004 成績轉換

題目出處 簡單題 思路 這題應該是學習後c的switch或if else if語法後經常做的題目型別 所以此題用上述兩種分支語句都能解題,而初學者可能多數這樣做 if input 100 input 0 else if input 90 input 100 printf a n else if in...

HDU2004 成績轉換

problem description 輸入乙個百分制的成績t,將其轉換成對應的等級,具體轉換規則如下 90 100為a 80 89為b 70 79為c 60 69為d 0 59為e input 輸入資料有多組,每組佔一行,由乙個整數組成。output 對於每組輸入資料,輸出一行。如果輸入資料不在0...