#include<iostream>#include<cstdlib>usingnamespace std;constfloat change =0.0833333;voidoutput(int);intmain(){int height;
cout<<"Please input your height:___\b\b\b";
cin>>height;output(height);system("pause");return0;}voidoutput(int height){
cout<<"Your height is "<<height*change<<" foots"<<endl;}
#include<iostream>#include<cstdlib>usingnamespace std;constdouble foots =12;constdouble pounds =2.2;constdouble memters =0.0254;voidchange(double,double,double);intmain(){double chi,cun,bang;
cout<<"Please input your height:";
cin>>chi>>cun;
cout<<"Please input your weight:";
cin>>bang;change(chi,cun,bang);system("pause");return0;}voidchange(double chi,double cun,double bang){double yingcun = foots*chi + cun;double m = memters * yingcun;double kg = pounds * bang;double bmi;
bmi = kg/(m*m);
cout<<"Your BMI is "<<bmi<<"."<<endl;}
#include<iostream>#include<cstdlib>usingnamespace std;constlong day =24;constlong hour =60;constlong minute =60;voidchange(int second){int tian,xiaoshi,fenzhong,miao;
tian = second/(day*hour*minute);
xiaoshi =(second -(tian*day*hour*minute))/(hour*minute);
fenzhong =(second -(tian*day*hour*minute)-(xiaoshi*hour*minute))/hour;
miao =(second -(tian*day*hour*minute)-(xiaoshi*hour*minute)-(fenzhong*minute));
cout<<second<<" seconds = "<<tian<<" days and "<<xiaoshi<<" hours and "<<fenzhong<<" minutes and "<<miao<<" seconds."<<endl;}intmain(){long second;
cout<<"Enter the seconds:";
cin>>second;change(second);system("pause");return0;}
#include<iostream>#include<cstdlib>usingnamespace std;intmain(){longdouble world;longdouble china;
cout<<"Enter the population of world: ";
cin>>world;
cout<<"Enter the population of china: ";
cin>>china;double a;
a =(china/world)*100;
cout<<"The population of china is "<<a<<"% of the world population"<<endl;system("pause");return0;}