HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


51114 - The traveling vehicle

Guest
• Review clarifications (1)

Section problems

• 51105 - Currency System
• 50891 - Smallest Number
• 50965 - Draw the Pattern
• 51103 - Is it a triangle?
• 50945 - Bigger or Smaller
• 50946 - Area of Rectangle
• 50949 - Vowel or Consonant
• 50881 - Exchange the Values
• 51114 - The traveling vehicle
• 50937 - Calculate the Average
• 50947 - Calculate the Average
• 50964 - Increasing or Decreasing
• 50948 - Translate Score into Grade
• 50280 - Division
• 50256 - Sequence
• 50257 - Galls village
• 50266 - Kovrov

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