Solve of URI 1014 (Consumption) in C & C++
Problem Description of URI Online Judge 1014:
Problem number: 1014.
Problem name: Consumption.
Problem level: 1.
Problem category: Beginner.
Points: 1.6 points.
Base time limit: 1 second.
Memory limit: 200 MB
Problem subject: Sequential.
Problem adapted by: Neilor Tonin (Brazil).
Link: https://www.urionlinejudge.com.br/judge/en/problems/view/1014
Solution language: C & C++
My profile: https://www.urionlinejudge.com.br/judge/en/profile/38770
Solution in C:
//URI online judge 1014 solution in C
//This solution is made & uploaded by Mehedi Hasan Kajol
#include<stdio.h>
int main(void){
double distance, fuel, average;
scanf(" %lf %lf ", &distance, &fuel);
average = distance / fuel;
printf("%.3lf km/l\n", average);
return 0;
}
Solution in C++:
//URI online judge 1014 solution in C++
//This solution is made & uploaded by Mehedi Hasan Kajol
#include<iostream>
using namespace std;
int main(void){
double distance, fuel, average;
cin >> distance >> fuel;
average = distance / fuel;
printf("%.3lf km/l\n", average);
return 0;
}