2.6
#include <iostream.h> double change(double y); int main() { cout<<"Enter the number of light years:\n"; double n; cin>>n; cout<<"Your number is"<<n<<endl; cout<<"==="<<change(n); cin.get(); cin.get(); return 0; } double change(double y) { return y*62340; }
2.7
//7 #include <iostream.h> void see(int h,int m); int main() { cout<<"Enter the number of hours:"; int h; cin>>h; // cout<< h<<endl; cout<<"Enter the number of minutes:"; int m; cin>>m; //cout<<m<<endl; see(h,m); cin.get(); cin.get(); cin.get(); cin.get(); return 0; } void see(int h,int m) { cout<<"Time"<<h<<":"<<m<<endl; }
——————————————————————————————————————————————————
//写的错误或者不好的地方请多多指导,可以在下面留言或者给我发邮件,指出我的错误以及不足,以便我修改,更好的分享给大家,谢谢。
转载请注明出处:https://www.royalchen.com/
author:royalchen
Email:royalchen@royalchen.com
———————————————————————————————————————————————————