Untitled
unknown
c_cpp
2 years ago
567 B
3
Indexable
#include <iostream>
using namespace std;
int main() {
int A, B;
cin >> A >> B;
double percentage = (static_cast<double>(B) / A) * 100;
if (percentage >= 85) {
cout << 5 << endl;
}
else if (percentage >= 71) {
cout << 4 << endl;
}
else if (percentage >= 51) {
cout << 3 << endl;
}
else if (percentage >= 11) {
cout << 2 << endl;
}
else if (percentage >= 1) {
cout << 1 << endl;
}
else {
cout << 0 << endl;
}
return 0;
}
Editor is loading...