[Title Description]: on the court Widereceiver, Lineman, Minimum attributes of the personnel required for the quarterback three locations ( Speed, Weight, Strength ) Required. Input: three data records. Speed, Weight, Strength, if the input speed is less than or equal to the requirement of the on-site location, the weight and strength are greater than or equal When the location on the stadium is required, the corresponding matching position is output. If there are multiple matching positions, the output is separated by a space in the middle. If there is no matching position, the output is No positions .
[Analysis]: It is very simple, but there is still a question about my code, that is, take the first two test cases in the question, at this time, there should be no more space for output (more space for my code). Only when this set of test data meets the requirements of multiple locations, there will be spaces between the two personnel. Whatever, this code has passed ..
This idea also needs to be output in sequence: widereceiver, lineman, quarterback ; otherwise, WA.
I 've been using water questions recently. In fact, I don't seem to have any gains, but let's do it first. Wait until you have the feeling, and click technical questions again.
// 240 K 0 Ms # include <iostream> using namespace STD; int main () {float speed; int weight, strenth; while (CIN> speed> weight> strenth, speed, weight, strenth) {bool flag = false; if (speed <= 4.5 & weight> = 150 & strenth> = 200) {cout <"wide Cycler"; flag = true ;} if (speed <= 6.0 & weight> = 300 & strenth> = 500) {cout <"lineman"; flag = true ;} if (speed <= 5.0 & weight> = 200 & strenth> = 300) {cout <"quarterback"; flag = true;} If (! Flag) cout <"no positions"; cout <Endl;} return 0 ;}
Poj 2070 filling out the team (water question)