#C9116. Student Grade Processing
Student Grade Processing
Student Grade Processing
Your task is to process student grade data and answer queries. You are given student records and a list of student names. Each record consists of a student's name and their score. The grading is done using the following scale:
- \(A: 90 \leq score \leq 100\)
- \(B: 80 \leq score < 90\)
- \(C: 70 \leq score < 80\)
- \(D: 60 \leq score < 70\)
- \(F: score < 60\)
The input begins with the student records (one per line) in the format Name,Score
, and is terminated by a line containing only END
. After that, an integer Q is provided indicating the number of queries, followed by Q lines each containing a student name. For each query, output the corresponding letter grade. If a queried student does not exist in the records, output Student not found
.
inputFormat
The input is read from standard input (stdin). It consists of two parts:
- Student Records: Each record is given in the format
Name,Score
on a separate line. The list of records ends with a line that containsEND
. - Queries: An integer Q indicating the number of queries, followed by Q lines, each containing a student name.
outputFormat
For each query, output the corresponding letter grade according to the grading scale on a new line. If the student name does not appear in the records, output Student not found
.
Alice,85
Bob,92
Charlie,78
David,64
Eve,55
END
5
Alice
Bob
Charlie
David
Eve
B
A
C
D
F
</p>