poj 2070 Filling Out the Team
2011-11-21 23:34
232 查看
Filling Out the Team
Description
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.
Input
Each 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"
Output
For 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 whitespace. You may leave an extra space at the end of the line. If a player can play no positions, write "No positions" on the line.
Sample Input
Sample Output
Time Limit: 1000MS | Memory Limit: 30000K | |
Total Submissions: 8302 | Accepted: 4572 |
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.
Input
Each 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"
Output
For 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 whitespace. You may leave an extra space at the end of the line. If a player can play no positions, write "No positions" on the line.
Sample Input
4.4 180 200 5.5 350 700 4.4 205 350 5.2 210 500 0 0 0
Sample Output
Wide Receiver Lineman Wide Receiver Quarterback No positions
#include<iostream> using namespace std; int main() { float data[3][3]={ 4.5,150,200, 6.0,300,500, 5.0,200,300 }; int state[3]={0}; char pos[3][15]={ "Wide Receiver", "Lineman", "Quarterback" }; float speed,weight,strength; int i; while(1) { cin>>speed>>weight>>strength; if(speed==0 && weight==0 && strength==0) break; for(i=0;i<3;i++) { if(speed<=data[i][0] && weight>=data[i][1] && strength>=data[i][2]) state[i]=1; else state[i]=0; } for(i=0;i<3;i++) { if(state[i]==1) cout<<pos[i]<<""; } if(state[0]==0&&state[1]==0&&state[2]==0) cout<<"No positions"; cout<<endl; } return 0; }
相关文章推荐
- 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比较)
- poj 2070 Filling Out the Team
- POJ 2070 Filling Out the Team(水题)
- ZOJ Problem Set – 2321 Filling Out the Team
- zoj 2321 Filling Out the Team
- poj2070 Filling Out the Team
- 2321_Filling Out the Team(比大小题,每次输出最后不得有空格)
- POJ2070浅析------Filling Out the Team
- HOJ 1746 Filling Out the Team
- TOJ 1825.Filling Out the Team
- POJ2070 Filling Out the Team
- ZOJ 2321 Filling Out the Team
- zoj2321 Filling Out the Team水题
- instances) and similar IP handles (that may additionally report that one particular person is filling out the prospect kind vari
- poj 3056 The Bavarian Beer Party (区间DP)
- POJ 1679 The Unique MST (次小生成树)
- BUG:upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected