HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


51114 - The traveling vehicle

Guest
• Review clarifications (1)

Section problems

• 50947 - Calculate the Average
• 50964 - Increasing or Decreasing
• 50948 - Translate Score into Grade
• 51104 - Steel
• 51113 - The Menu
• 51112 - Even Numbers
• 51105 - Currency System
• 51103 - Is it a triangle?
• 51114 - The traveling vehicle
• 50251 - Symmetric matrix
• 50252 - Birthday
• 50239 - Eating cheese
• 50244 - Chessboard Pattern
• 50245 - Santa Gifts
• 50256 - Sequence
• 50257 - Galls village
• 50280 - Division

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