國立屏東商業技術學院 資訊工程系 物件導向程式設計
練習if, switch與條件運算式。
Please input a number: 3 The sum of 1 to 3 is 6.
Please input a number: 12 Your input larger than 10.
Please input a number: 0 Error
grade | A | B | C | D | E |
---|---|---|---|---|---|
comment | Excellent | Good | Average | Poor | Failing |
Grade (A-E) : A Excellent
Grade (A-E) : c Average
Grade (A-E) : E Failing
Enter month (1-12): 6 Enter day (1-31): 1 Your input date is the 1st day of June.
Enter month (1-12): 7 Enter day (1-31): 11 Your input date is the 11th day of July.
Enter month (1-12): 8 Enter day (1-31): 2 Your input date is the 2nd day of August.
Enter month (1-12): 6 Enter day (1-31): 21 Your input date is the 21st day of June.
1st, 2nd, 3rd, 4th, 5th, 6th, … 10th, 11th, 12th,13th…20th 21st, 22nd, 23rd, 24th,….30th, 31st.