Description
The switch statement is required. If only the if statement is submitted successfully, the score is zero.
Amen……> <In fact, switch is very helpful ~
LCL liked Harry Potter very much. Google camp held a 3D modeling competition at the end of last semester. At the end of the award, some titles were needed for evaluation, therefore, LCL wants to know what the corresponding rules in HP are, so she handed this question to you ~~~ (Why does she always give you these messy questions? =)
After a variety of searches in Google, you have found the corresponding rules for rating:
"Scoring mark -- scoring title o -- outstanding e -- exceeds expectations a -- acceptable p -- poor d -- dreadful" now we need to provide an award statistics for contestants in the 3D modeling competition, enter the score mark of the contestants and output the corresponding score title according to the sample requirements. If any of the score marks that do not belong to the above items appears, the "sorry, your prize doesn't exist."
-
-
Input
-
-
The input includes the T group data. The first row contains a positive integer T (0 <t <= 200), indicating that the T group data will be read next. 2nd ~ T + 1 line: contains a single character C, indicating the score mark of the contestant. (C is an uppercase English letter)
Output
Output a row of data in each group. If the score mark exists, output "your prize is '(corresponding score title )'!", For P or D, output "your prize is '(corresponding score title )'... ", if the score mark does not exist, the output is" sorry, your prize doesn't exist. the output is subject to the sample.
Sample Input
4
P
r
I
sample output
your prize is 'poor '...
sorry, your prize doesn't exist.
your prize is 'accesstable '!
sorry, your prize doesn't exist.
the nested if else is used here.
# include
int main () {int number, T; char a [3]; scanf ("% d", & number); For (t = 1; t <= number; t ++) {scanf ("% s", a); if (a [0] = 'P') {printf ("your prize is 'poor '... \ n ");} else if (a [0] = 'O') {printf (" your prize is 'outstanding '! \ N ");} else if (a [0] = 'A') {printf (" your prize is 'accesstable '! \ N ");} else if (a [0] = 'D') {printf (" your prize is 'dreadful '... \ n ");} else if (a [0] = 'E') {printf (" your prize is 'exceeds expectations '! \ N ");} else {printf (" sorry, your prize doesn't exist. \ n ") ;}} return 0 ;}