2321_Filling Out the Team(比大小题,每次输出最后不得有空格)

Over the years, the people of the great city of Pittsburgh have repeatedly demonstrated a collective expertise at football second to none. Recently a spy has discovered the true source of the city's football power-a wizard known only as "Myron," who is infallible at selecting the proper position at which each player will excel.

Now that you know the source of Pittsburgh's wisdom, you are determined to provide your school's football team with a computer program that matches the wisdom of "Myron." You have consulted with the best football minds you can find, and they have dispensed their wisdom on the slowest speed, minimum weight, and minimum strength required to play each position.

PositionSlow.SpeedMin.WeightMin.Strength
Wide Receiver4.5150200
Lineman6.0300500
Quarterback5.0200300

Using this knowledge, you will develop a program that reads in several players physical attributes and outputs what position(s) they are able to play.


Input

Each line of the input file will list the attributes for one player:

<speed> <weight> <strength>

Each number will be a real-valued number. The file will end with a line reading "0 0 0".


Output

For each player, you will output one line listing the positions that player can play. A player can play a position if each of their attributes is greater or equal to the minimum for weight and strength, and less than or equal to the slowest speed. If a player can play multiple positions, output them in the order listed above, separated by whitespace. You can not leave an extra space at the end of the line. If a player can play no positions, write "No positions" on the line.


Sample Input

4.4 180 200
5.5 350 700
4.4 205 350
5.2 210 500
0 0 0


Sample Output

Wide Receiver
Lineman
Wide Receiver Quarterback
No positions


Source: Mid-Atlantic USA 2004

#include<iostream>
using namespace std;
int main()
{
double sp;
int we,st;
bool flag;
while(cin>>sp>>we>>st&&sp&&we&&st)
{
        flag=true;
if(sp<=4.5&&we>=150&&st>=200)
{
cout<<"Wide Receiver";
flag=false;
}


if(sp<=6.0&&we>=300&&st>=500)
{   
if(!flag)//在此输出前加" "保证输出最后不带空格
cout<<" ";
cout<<"Lineman";
flag=false;
}
if(sp<=5.0&&we>=200&&st>=300)
{
if(!flag)
cout<<" ";
cout<<"Quarterback";
flag=false;
}
if(flag)
cout<<"No positions";
cout<<endl;


}
return 0;
}



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值