Poj 2070 filling out the team (water question)

Source: Internet
Author: User

[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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.