Untitled
unknown
plain_text
2 months ago
502 B
12
Indexable
#include <iostream> #include <cmath> using namespace std; void PrinTF(int &x,int &grade) { if (90 <= x) { grade = 4; } else if (80 <= x && 90 > x) { grade = 3; } else if (70 <= x && 80 > x) { grade = 2; } else if (60 <= x && 70 > x) { grade = 1; } else { grade = 0; } } int main() { int grade = 5; int x; cin >> x; PrinTF(x, grade); cout << grade; return 0; }
Editor is loading...
Leave a Comment