Poj Getting started water finishing 2

Source: Internet
Author: User

1.3979 fractional addition and subtraction

Solution: According to the topic description Step by step writing, finally pay attention to find the maximum common factor, numerator solution, attention to Integer


2.2017 Speed Limit

Description: Bill and Ted's mileage meter is broken, but they have a stopwatch available, so they can record the speed and the actual walk, but this stopwatch records the way the time is problematic,

Speed in Miles Perhour Total elapsed time in hours
20 2
30 6
10 7
Take the table, for example, the first 2 hours are 20km/h,6-2 hours is. Km/h,7-6 Hour is 10km/h

So the whole mileage is (2) + (4) (+) + (1) (Ten) = + + + = 170km

Input: There will be a lot of data, 1 <= n <= 10,n is an integer, followed by n rows of data s,t, and the above table format, 1 <= s <= and 1 <= t <= 12,-1 represents input End

Output: How far the car is, and the output of miles behind each line

Solution: In accordance with the above-mentioned solution step-by-step calculation is good


3.2390 Bank Interest

5 5000 4

Enter the annual interest rate, amount, year, number of amounts that can be obtained after the compound interest is output, and note the output integer

Year 1:1.05 * 5000 = 5250
Year 2:1.05 * 5250 = 5512.5
Year 3:1.05 * 5512.50 = 5788.125
Year 4:1.05 * 5788.125 = 6077.53125
Note: Intermediate calculations are not rounded, followed by rounding


4.2509 Peter ' s smokes

Peter has a total of n cigarettes, but also can be a new cigarette with K cigarette butts, he can smoke a maximum number of cigarettes

Keep circulating, when n<k, exit


5.1005 I Think i need a houseboat

Fred Mapper has a peninsula that is eroded every day at a rate of 50 square kilometres, and he wants to know how long his land will be eroded.

Note the output format and the final end of outputs. Note the last "."





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.