HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Contests > Epoka Science Olympiad 2017 - 9th Grade > problem:


2. 51114 - The traveling vehicle

Epoka Science Olympiad 2017 - 9th Grade

Start: May.06.2017 at 10:00:00 AM
Finish: May.06.2017 at 12:30:00 PM
The contest is finished!
• Contest scoreboard

Guest
• Review clarifications (1)

Contest problems

• 1. 51113 - The Menu
• 2. 51114 - The traveling vehicle
• 3. 51116 - The Star Triangle
• 4. 51115 - Pascal Triangle

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.

The traveling vehicle

Question: The distance a vehicle travels can be calculated as follows:
distance = speed * time
Write a program that asks the user for the speed of a vehicle (in miles per hour) and how many hours it has traveled. The program should then use a loop to display the distance the vehicle has traveled for each hour of that time period. Here is an example of the output:

What is the speed of the vehicle in mph? 40
How many hours has it traveled? 3

Hour       Distance Traveled
--------------------------------------------
1                        40
2                        80
3                        120

Input specification: In the first line, program will get two numbers s (speed) and t (time).

Output specification: Print out the amount of distances one after another with a space in between that the vehicle has traveled for each hour.

Sample Input Sample Output
100 3
80 5
100 200 300
80 160 240 320 400



Для отправки решений необходимо выполнить вход.

www.contester.ru