Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
567 B
1
Indexable
Never
#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;
}