cpp_primer_plus/ch03/07.cpp
2022-08-23 23:01:08 +01:00

13 lines
328 B
C++

# include <iostream>
using namespace std;
double km2mile = 0.6214;
double ga2l = 3.875;
int main(){
double ga, mi, eu_rate;
cout << "The usage of oil (L) per 100 km: ";
cin >> eu_rate;
double us_rate = km2mile * ga2l / eu_rate;
cout << "Every gallon, the driver can drive " << us_rate << " mile(s)" << endl;
return 0;
}