#include<iostream>usingnamespace std;intmain(){double degree, minute, second=0;
cout <<"Enter a latitude in degrees,minutes,and seconds:"<< endl;
cout <<"First,enter the degree:";
cin >> degree;
cout <<"Next,enter the minutes of arc:";
cin >> minute;
cout <<"Finally,enter the seconds of arc:";
cin >> second;double total_degree;
total_degree = degree + minute /60+ second /60/60;
cout << degree <<" degrees,"<< minute <<" minutes,"<< second <<" seconds = "<< total_degree <<" degree"<< endl;system("pause");return0;}
#include<iostream>usingnamespace std;intmain(){longlong seconds;int tem;int day, hour, minute, second;
cout <<"Enter the number of seconds:";
cin >> seconds;
day = seconds /(24*60*60);
tem = seconds %(24*60*60);
hour = tem /(60*60);
tem = tem %(60*60);
minute = tem /60;
second = tem %60;
cout << seconds <<" seconds = "<< day <<" days,"<< hour
<<" hours,"<<minute<<" minutes,"<<second <<" seconds"<< endl;system("pause");return0;}
#include<iostream>usingnamespace std;intmain(){longlong popu_world, popu_US;
cout <<"Enter the world's population:";
cin >> popu_world;
cout <<"Enter the population of the US:";
cin >> popu_US;double percentage;
percentage =double(popu_US)/double(popu_world);
cout <<"The population of the US is "<< percentage *100<<"% of the world population."<< endl;system("pause");return0;}
#include<iostream>usingnamespace std;intmain(){double mile, gallon;double mile_per_gallon;
cout <<"Please input mileage(mile):";
cin >> mile;
cout <<"Please input comsumption of oil(gallon):";
cin >> gallon;
mile_per_gallon = mile / gallon;
cout <<"The distance per gallon is "<< mile_per_gallon <<" mile."<< endl;double km, litre;double litre_per_100km;
cout <<"Please input mileage(km):";
cin >> km;
cout <<"Please input comsumption of oil(litre):";
cin >> litre;
litre_per_100km =100* litre / km;
cout <<"The comsumption of oil per 100km is "<< litre_per_100km <<" litre"<< endl;system("pause");return0;}
#include<iostream>usingnamespace std;intmain(){double fuel_comsuption_eu =0.0;double fuel_comsuption_us =0.0;printf("Please input fuel comsuption in Europ standard:");
cin >> fuel_comsuption_eu;
fuel_comsuption_us =62.14*3.785/ fuel_comsuption_eu;
cout <<"the fuel comsuption in US standard is "<< fuel_comsuption_us <<"mile/gallon"<< endl;system("pause");return0;}
在这里插入代码片#include<iostream>using namespace std;const int Inch2Foot = 12;int main(){ int height_inch; int heighe_foot; int height_inch_ = 0; cout << "please input your height in inch___\b\b\b:"; cin >> heigh