poj2070 Filling Out the Team

来源:互联网 发布:nginx下载 linux 编辑:程序博客网 时间:2024/05/20 14:26

读懂题,基本就AC了~~~具体代码如下:
#include<stdio.h>#include<stdlib.h>#include<math.h>int main(){   double a;   int b,c;   int temp1,temp2,temp3;   while(~scanf("%lf %d %d",&a,&b,&c)&&a&&b&&c){     temp1 = 0;     temp2 = 0;     temp3 = 0;     if(a<=4.5&&b>=150&&c>=200) {            printf("Wide Receiver ");            temp1 = 1;     }     if(a<=6.0&&b>=300&&c>=500) {            printf("Lineman ");            temp2 = 1;     }     if(a<=5.0&&b>=200&&c>=300) {            printf("Quarterback ");            temp3 = 1;     }     if((!temp1)&&(!temp2)&&(!temp3))        printf("No positions");     printf("\n");   }   return 0;


原创粉丝点击