#include "stdafx.h"
#include "iostream"
using namespace std;
//alidoran
int main()
{
int score;
cout << "Enter your test score: "; cin >> score;
switch (score / 10)
{
case 9: cout << "Your grade is an A." << endl; break;
case 8: cout << "Your grade is a B." << endl; break;
case 7: cout << "Your grade is a C." << endl; break;
case 6: cout << "Your grade is a D." << endl; break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0: cout << "Your grade is an F." << endl; break;
default: cout << "Error: score is out of range.\n";
}
cout << "Goodbye." << endl;
system("pause");
return 0;
}
- ۹۶/۱۱/۱۷