Untitled
unknown
plain_text
3 years ago
1.2 kB
9
Indexable
#include <iostream>
#include <math.h>
using namespace std;
struct Kakoyto_Agroshkolnik{
string name;
int clas;
int mark;
int propusk;
int strong;
};
int main() {
int o = 0;
char n;
Kakoyto_Agroshkolnik a;
Kakoyto_Agroshkolnik b;
Kakoyto_Agroshkolnik c;
setlocale(LC_ALL, "Russian");
for (int i = 1; i < 4; i++) {
cout << "Введите имя " << i << " школьника ";
if (i == 1)cin >> a.name;
else if (i == 2) cin >> b.name;
else cin >> c.name;
cout << "Введите кол-во пропусков " << i << " школьника ";
if (i == 1)cin >> a.propusk;
else if (i == 2) cin >> b.propusk;
else cin >> c.propusk;
cout << "Введите силу " << i << " школьника ";
if (i == 1)cin >> a.strong;
else if (i == 2) cin >> b.strong;
else cin >> c.strong;
cout << "\n";
}
if (a.strong * a.propusk > o) {
n = 'a';
}
if (b.strong * b.propusk > o) {
n = 'b';
}
if (c.strong * c.propusk > o) {
n = 'c';
}
if (n == 'a') cout << a.name << " Самый крутой";
if (n == 'b') cout << b.name << " Самый крутой";
if (n == 'c') cout << c.name << " Самый крутой";
}Editor is loading...