略忧伤,身边的人说好了一块学好技术好好找工作的,现在都转方向考研。。。西哒哒
昨天写的 没来得及敲 其实你就是爱以后不要找借口
2.7.6
#include<iostream>
using namespace std;
double light(double n);
int main()
{
double n,m;
cout<<"Enter the number of light years:";
cin>>n;
m=light(n);
cout<<n<<" light years = "<<m<<" astronomical units."<<endl;
return 0;
}
double light(double n)
{
return n*63240;
}
2.7.7
#include<iostream>
using namespace std;
void timeshow(double n,double m);
int main()
{
double n,m;
cout<<"Enter the number of hours:";
cin>>n;
cout<<"Enter the number of minutes:";
cin>>m;
timeshow(n,m);
}
void timeshow(double n,double m)
{
cout<<"Time: "<<n<<":"<<m<<endl;
}
3,7.1
#include<iostream>//<span style="color:#ff0000;">怎么使用下划线来指示输入位置</span>
using namespace std;
const int inchi=12;
int main()
{
double n;
cout<<"Enter your tall inch: _";
cin>>n;
cout<<"your tall inchi is: "<<n*inchi<<endl;
return 0;
}
3.7.2
#include<iostream>
using namespace std;
const double meter=0.0254;
const double kilograme=2.2;
int main()
{
double n,m,b;
cout<<"Enter your tall inchi: ";
cin>>n;
cout<<"Enter your tall inch: ";
cin>>m;
cout<<"Enter your body bones: ";
cin>>b;
double tall=(n*12+m)*meter;
double grame=b/kilograme;
double BMI=grame/(tall*tall);
cout<<"BMI指数是"<<BMI<<endl;
return 0;
}
以后是不是写代码的时候要带上一本英语词典!?词汇量也太少了,真是醉了。。。