21 Jul Aurora Saturday 14:30 Python Practice 20.07.18.
Question 1:
We have learned infix, prefix and postfix, please write the missing prefix and postfix in the table blow:
infix 
prefix 
postfix 
A+B 
+AB 
AB+ 
A+B*C 
+A*BC 
ABC*+ 
(A+B)*C 
*+ABC 
AB+C* 
A+B*C+D 
++A*BCD 
ABC*+D+ 
(A+B)*(C+D) 


A*B+C*D 


A+B+C+D 


Question 2:
Today in gym class, your class decided to play dodgeball, and Jack is selected as one of the team captains! N students are lined up in a row, waiting to be put on teams. Jack is allowed to pick multiple students as long as they are adjacent to one another, and the first letter of each of their names are the same (case insensitive).
As an assistant to Jack, help him decide what his first choice should be by writing a program to determine all the possible choices he could make!
Input Specification
The first line contains the integer N (1≤N≤105), representing the total number of students.
The second line contains N space separated strings, each representing the name of the ith student in line. Each name will be no longer than 20 characters and only contain letters from the English alphabet.
Output Specification
Output one integer, representing the total number of choices Jack can make.
Sample Input 5 Sarah Timmy Turner Betty Bob Sample Output 7 Explanation for Sample Input The possible groups of people that aurpine could choose are: Sarah Timmy Turner Betty Bob Timmy, Turner Betty, Bob
Sorry, the comment form is closed at this time.