Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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
|
Для отправки решений необходимо выполнить вход.
|