Advertisement
Spocoman

02. Grades

Oct 26th, 2023
601
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void print(double n) {
  6.     string result =
  7.         n < 3.00 ? "Fail" :
  8.         n < 4.00 ? "Poor" :
  9.         n < 4.50 ? "Good" :
  10.         n < 5.50 ? "Very good" :
  11.         n <= 6.00 ? "Excellent" : "";
  12.  
  13.     cout << result << endl;
  14. }
  15.  
  16. int main() {
  17.     double grade;
  18.     cin >> grade;
  19.  
  20.     print(grade);
  21.  
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement