URI ONLINE JUDGE SOLUTION 1014 - Consumption

Problem:

Calculate a car's average consumption being provided the total distance traveled (in Km) and the spent fuel total (in liters).

Input

The input file contains two values: one integer value X representing the total distance (in Km) and the second one is a floating point number representing the spent fuel total, with a digit after the decimal point.

Output


Present a value that represents the average consumption of a car with 3 digits after the decimal point, followed by the message "km/l".

sample input output


Solution:

#include<stdio.h>
int main()
{
    int X;
    double Y,con;
    scanf("%d%lf",&X,&Y);
    con=(X/Y);
    printf("%0.3lf km/l\n",con);
    return 0;

}

Comments

Post a Comment

Popular posts from this blog

URI ONLINE JUDGE SOLUTION 1021 - Banknotes and Coins

URI ONLINE JUDGE SOLUTION 1040 - Average 3

URI ONLINE JUDGE SOLUTION 1036 - Bhaskara's Formula