jhjh

 avatar
unknown
c_cpp
2 years ago
1.0 kB
5
Indexable
#include <iostream>
using namespace std;

int main()
{
	setlocale(LC_ALL, "russian");
	double a, b, c = 0;
	cout << "Введите общее кол-во баллов и кол-во получённые баллов" << endl;
	cin >> a >> b;
	if (a >= 0 and b >=0 and a <= 100 and b <= 100)
	{
		cout << "0 - 0% от возможных баллов" << endl;
		cout << "1 - 1%-10% от возможных баллов" << endl;
		cout << "2 - 11%-50% от возможных баллов" << endl;
		cout << "3 - 51%-70% от возможных баллов" << endl;
		cout << "4 - 71%-84% от возможных баллов" << endl;
		cout << "5 - 85%-100% от возможных баллов" << endl;
		c = (b / a) * 100;
		if (c == 0) cout << "0";
		else if (c >= 1 and c <= 10) cout << "1";
		else if (c >= 11 and c <= 50) cout << "2";
		else if (c >= 51 and c <= 70) cout << "3";
		else if (c >= 71 and c <= 84) cout << "4";
		else if (c >= 85 and c <= 100) cout << "5";
	}
	else return 0;
}
Editor is loading...