Editorial for WC '18 Contest 1 J3 - Comparing Grades


Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Let's create a function \text{Grade}(g) which takes a percentage grade g as its argument, and returns the letter grade which corresponds to g. This function may be implemented with a series of if-statements which check which of the letter grades' ranges g falls into. We can then check whether \text{Grade}(A) is equal to \text{Grade}(B), outputting Same if so, and Different otherwise.


Comments

There are no comments at the moment.