ZOJ 2321


#include<iostream>
#include<string>
using namespace std;

 

struct MAN
{
    float sp;
    int a,b;
    char name[40];
}man[3];

 

int main()
{
    man[0].sp=4.5;
    man[0].a=150;
    man[0].b=200;
    strcpy(man[0].name,"Wide Receiver");

    man[1].sp=6.0;
    man[1].a=300;
    man[1].b=500;
    strcpy(man[1].name,"Lineman");

    man[2].sp=5.0;
    man[2].a=200;
    man[2].b=300;
    strcpy(man[2].name,"Quarterback");

    bool flag;
    float speed;
    int weight,strength;
    while(cin>>speed>>weight>>strength && !(speed==0 &&weight==0 &&strength==0))
    {
        int i;
        flag=0;
        for(i=0;i<3;i++)
        {
            
            if(weight>=man[i].a && strength>=man[i].b && speed<=man[i].sp)
            {
                if(flag)
                    cout<<" ";
                cout<<man[i].name;
                flag=1;
            }
        }
        if(!flag)
            cout<<"No positions";
        cout<<endl;
    }

    return 0;
}

 

转载于:https://www.cnblogs.com/VRS_technology/archive/2010/05/12/1733589.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值