//3.6编程练习c
#include<iostream>
//1
/*
const int inch = 12;
int main() {
using namespace std;
int feet;
cout << "Please enter your height:____\b\b\b\b" ;
cin >> feet;
cout << "\nIt's " << feet << " feet,same as " << feet * inch << " inches.";
return 0;
}
*/
//2
/*
const int FtI = 12;
const double ItM = 0.0254;
const double PtK = 1 / 2.2;
int main() {
using namespace std;
int feet, inch, pound;
cout << "Please enter your height and weight" << endl;
cin >> feet;
cin >> inch;
cin >> pound;
int height = feet * FtI + inch;
cout << "Your height is " << height << " inches,same as " << height*ItM << " miles." << endl;
cout << "Your weight is " << pound * PtK << " kg." << endl;
cout << "Your BMX is " << (pound * PtK) /(height*ItM* height*ItM);
return 0;
}
*/
//3
/*
const double DtM = 60;
const double MtS = 60;
int main() {
using namespace std;
double degree, minute, second;
cout << "Enter a latitude in degrees,minutes, and seconds:" << endl;
cout << "First, enter the degrees: ";
cin >> degree;
cout << "Next, enter the minutes of arc: ";
cin >> minute;
cout << "Finally, enter the seconds of arc: ";
cin >> second;
double dtm = minute / DtM;
double mts = second / MtS;
double latitude = degree + dtm + mts;
cout << degree << " degrees, " << minute << " minutes, " << second << " seconds = " << latitude << " degrees";
return 0;
}
*/
//4
/*
const int Day = 24 * 60 * 60;
const int Hour = 60*60;
const int Minute = 60;
int main() {
using namespace std;
long long int second;
cout << "Enter the number of seconds: ";
cin >> second;
int days = second / Day;
int hours = second % Day / Hour;
int minutes = (second % Day) % Hour / Minute;
int seconds = (second % Day) % Hour % Minute;
cout << second << " seconds = " << days << " days, " << hours << " hours, " << minutes << " minutes, " << seconds << " seconds";
return 0;
}
*/
//5
/*
int main() {
using namespace std;
long long int Am;
long long int To;
cout << "Enter the world's population: ";
cin >> To;
cout << "Enter the population of US: ";
cin >> Am;
cout << "The population of the US is " << double(Am) / double(To)*100 << "% of the world population.";
return 0;
}
*/
//6
/*
int main() {
using namespace std;
int mile, gal;
cout << "Enter your miles: ";
cin >> mile;
cout << "Enter your gallon:";
cin >> gal;
cout << "Your car's mpg is: " << double(mile) / double(gal);
return 0;
}
*/
//7
/*
const double mile = 0.6214;
const double gal = 0.264172;
int main() {
using namespace std;
int kmeter, litre;
cout << "Enter your kmeter: ";
cin >> kmeter;
cout << "Enter your litre: ";
cin >> litre;
cout << "The Mpg in Eu is " << double(litre) / double(kmeter)<<endl ;
cout << "The Mpg in US is " << (double(kmeter)*mile) / (double(litre)*gal);
return 0;
}
*/