TOJ 1825.Filling Out the Team
来源:互联网 发布:奇迹英语软件下载 编辑:程序博客网 时间:2024/06/05 07:28
题目链接:http://acm.tju.edu.cn/toj/showp1825.html
Time Limit: 1.0 Seconds Memory Limit: 65536K
Total Runs: 1743 Accepted Runs: 730
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.
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.
InputEach 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"
OutputFor 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 a single space. You're demanded to leave an extra space at the end of the line. If a player can play no positions, write "No positions" on the line with no tailing space.
Sample Input4.4 180 2005.5 350 7004.4 205 3505.2 210 5000 0 0Sample Output
Wide Receiver Lineman Wide Receiver Quarterback No positions
Source: Mid Atlantic North America 2004
水题,写几个if-else就好。
#include <stdio.h>int main(){double speed;int tag1,tag2,tag3,w,s;while(~scanf("%lf%d%d",&speed,&w,&s)&&(speed+w+s)){tag1=tag2=tag3=0;if(speed<=4.5&&w>=150&&s>=200) tag1=1;if(speed<=6.0&&w>=300&&s>=500) tag2=1;if(speed<=5.0&&w>=200&&s>=300) tag3=1;if(tag1)if(tag2)if(tag3)printf("Wide Receiver Lineman Quarterback \n");elseprintf("Wide Receiver Lineman \n");elseif(tag3)printf("Wide Receiver Quarterback \n");elseprintf("Wide Receiver \n");elseif(tag2)if(tag3)printf("Lineman Quarterback \n");elseprintf("Lineman \n");elseif(tag3)printf("Quarterback \n");elseprintf("No positions\n");}}
- TOJ 1825.Filling Out the Team
- poj2070 Filling Out the Team
- zoj2321 Filling Out the Team
- POJ2070 Filling Out the Team
- zoj 2321 Filling Out the Team
- zoj2321 Filling Out the Team水题
- ZOJ 2321 Filling Out the Team
- zoj 2321 Filling Out the Team
- poj 2070 Filling Out the Team
- POJ2070浅析------Filling Out the Team
- HOJ 1746 Filling Out the Team
- ZOJ 2321 Filling Out the Team
- poj 2070 Filling Out the Team
- POJ 2070 Filling Out the Team(水题)
- POJ 2070 Filling Out the Team G++
- POJ 2070 Filling Out the Team(水~)
- POJ 2070 Filling Out the Team(我的水题之路——double比较)
- Toj 3208 Cow Frisbee Team
- RocketMQ 的基础与规范
- STL源码剖析之空间配置器
- hdu 4438 && la 6389
- Redis 用户验证
- 来自定义一个矩形的进度条
- TOJ 1825.Filling Out the Team
- php001-php基本概念
- arraylist安全性
- windows查看某个端口被谁占用
- intelliJ IDEA 快捷键
- day13String,StringBuffer,StringBuilder
- 通过StatusStrip访问 toolStripStatusLabel的属性
- ios 产生和监听事件notification
- 面试试题干货