Calculate Passing and Failing Test Scores
題目說明
請撰寫一程式,計算輸入的測驗分數中通過和不及格的數量。
條件如下:
- 一個分數若大於或等於 60 為通過,否則為不及格。
- 程式允許使用者輸入多個分數。
- 當使用者輸入 -1 時,程式停止輸入並顯示結果。
輸出內容包括:
- 總輸入的分數數量(不包括 -1)。
- 通過分數的數量。
- 不及格分數的數量。
輸入
一組整數分數(每次輸入一個分數),範圍為 0 至 100。 輸入 -1 表示結束。
輸出
- 輸入的總分數數量(不包括 -1)。
- 通過分數的數量。
- 不及格分數的數量。
範例輸入 #1
80
45
60
-1
範例輸出 #1
You entered 3 scores.
The number of passed scores is 2.
The number of failed scores is 1.
範例輸入 #2
60
60
60
-1
範例輸出 #2
You entered 3 scores.
The number of passed scores is 3.
The number of failed scores is 0.
Comments