poj 2070(水题)

#include<iostream>
using namespace std;
int main(){
    char a[][15] = {"Wide Receiver","Lineman","Quarterback"};
    float speed[] = {4.5,6.0,5.0};
    int weight[] = {150,300,200};
    int strength[] = {200,500,300};
    float sp;
    int wgt,sth;
    bool flag[3],flag_total; 
    int i,j;
    while(scanf("%f%d%d",&sp,&wgt,&sth)==3&&sp){
        for(i=0;i<3;i++){
            flag[i] = false;
            if(sp<=speed[i]&&wgt>=weight[i]&&sth>=strength[i]){
                flag[i] = true;
            }
        }
        flag_total = true;
        for(i=0;i<3;i++){
            if(flag[i]){
                flag_total = false;
                printf("%s ",a[i]);
            }
        }
        if(flag_total)printf("No positions");
        printf("\n");
    }
    return 0;
}

 

posted @ 2021-11-18 11:10  智人心  阅读(24)  评论(0)    收藏  举报