#include "iostream"
#include "string"
using namespace std;
struct Info
{
string pos;
double speed;
int weight;
int strength;
};
int main()
{
bool flag;
double sp;
int w, s, i;
Info info[3];
info[0].pos = "Wide Receiver", info[0].speed = 4.5, info[0].weight = 150, info[0].strength = 200;
info[1].pos = "Lineman", info[1].speed = 6.0, info[1].weight = 300, info[1].strength = 500;
info[2].pos = "Quarterback", info[2].speed = 5.0, info[2].weight = 200, info[2].strength = 300;
while (cin >> sp >> w >> s)
{
flag = false;
if (sp ==0 && w == 0 && s == 0) break;
for (i = 0; i < 3; i++)
{
if (info[i].speed >= sp && info[i].weight <= w && info[i].strength <= s)
{
if (flag)
cout << " ";
cout << info[i].pos;
flag = true;
}
}
if (!flag)
cout << "No positions" << endl;
else
cout << endl;
}
system("pause");
}
poj 2070 Filling Out the Team
最新推荐文章于 2018-05-13 13:15:59 发布