📄 1949776_ac_0ms_72k.cpp
字号:
# include <stdio.h>
# include <string.h>
struct node
{
float slowest_speed;
int min_weight, min_strength;
char name[20];
}position[3];
int main()
{
int i;
int mark;
int weight, strength;
float speed;
position[0].min_strength = 200;
position[0].min_weight = 150;
position[0].slowest_speed = 4.5;
strcpy(position[0].name,"Wide Receiver");
position[1].min_strength = 500;
position[1].min_weight = 300;
position[1].slowest_speed = 6.0;
strcpy(position[1].name,"Lineman");
position[2].min_strength = 300;
position[2].min_weight = 200;
position[2].slowest_speed = 5.0;
strcpy(position[2].name,"Quarterback");
while(scanf("%f%d%d",&speed,&weight,&strength)==3&&weight&&strength&&speed)
{
mark = 0;
for(i = 0; i < 3; i++)
{
if(speed<=position[i].slowest_speed&&weight>=position[i].min_weight&&strength>=position[i].min_strength)
{
mark++;
if(mark > 1)
printf(" ");
printf("%s",position[i].name);
}
}
if(!mark)
printf("No positions");
printf("\n");
}
return 1;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -