URI Online Judge | 1017
Fuel Spent
Adapted by Neilor Tonin, URI Brazil | Timelimit: 1
Little John wants to calculate and show the amount of spent fuel liters on a trip, using a car that does 12 Km/L. For this, he would like you to help him through a simple program. To perform the calculation, you have to read spent time (in hours) and the same average speed (km/h). In this way, you can get distance and then, calculate how many liters would be needed. Show the value with three decimal places after the point.
Input
The input file contains two integers. The first one is the spent time in the trip (in hours). The second one is the average speed during the trip (in Km/h).
Output
Print how many liters would be needed to do this trip, with three digits after the decimal point.
Input Sample | Output Sample |
10 85 | 70.833 |
2 92 | 15.333 |
22 67 | 122.833 |
Solution
#include <stdio.h>
int main() {
double m,n,o;
scanf("%lf%lf",&m,&n);
o=(m*n/12);
printf("%.3lf\n",o);
return 0;
}
- How to Use URI Online Judge to Improve Your Coding Skills and Boost Your Career
- BEST FREE GIFT CARD GENERATOR in 2022
- উইন্ডোজ 11 এসে গেল, নজরকাড়া লুক, তাক লাগানো ফিচার্স!
- URI 2694 Solved by C programming
- URI Online Solve | 1957 Converting to Hexadecimal- Solution
- Android custom toolbar Android Studio | Android Tutorial
- URI Online Judge | 1040 Solution | Average 3
- URI Online Judge | 1038 Solution |Snack
- URI Online Judge | 1037 Solution | Interval
- URI Online Judge | 1036 Solution | Bhaskara’s Formula
- URI Online Judge Solution| 1035 Selection Test 1
- URI Online Judge Solution| 1021 Banknotes and Coins
- URI Online Judge Solution| 1020 Age in Days
- URI Online Judge Solution| 1019 Time Conversion
- URI Online Judge Solution| 1018 Banknotes