GPA Calculator
Time limit1sMemory limit512 MB
Given a string of concatenated letter grades such as A+ and B, print the arithmetic mean of their grade points.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem
Jonghyun is building a program with Yeongdo that pulls data from the school portal and calculates Jonghyun's own grade points. Jonghyun wants to print the average grade point using the grade data Yeongdo extracted from the site.
The grade points for each grade follow this table.
Input
The first line contains a string of the grades for each course. There are no separators between grades. The string consists only of characters from the table above, and its length is at most .
Output
Print the arithmetic mean of the grade points for the grades listed in on the first line. An answer is accepted if its absolute or relative error is at most .