欢迎来到天天文库
浏览记录
ID:13440619
大小:20.50 KB
页数:3页
时间:2018-07-22
《c++ primer plus 第2章 编程练习答案》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、编程练习1、#includeintmain(){usingnamespacestd;cout<<"Myname:";cout<<"LiMing.Andmyaddressis";cout<<"SunYat-SenUniversity.";system("pause");return0;}2、#includeintmain(){usingnamespacestd;cout<<"请输入一个以浪为单位的距离:";doublewave;cin>>wave;cout<2、endl;system("pause");return0;}3、#includevoidprint1(int);voidprint2(int);usingnamespacestd;intmain(){print1(2);print2(2);system("pause");return0;}voidprint1(intnum){for(inti=0;i3、yrun"<doublecen_to_Fah(double);intmain(){usingnamespacestd;cout<<"PleaseenteraCelsiusvalue:";doublevalue;cin>>value;cout<4、rn1.8*value+32.0;}5、#includedoubleLY_to_AU(double);intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_years;cout<5、AU(doublenum){return63240*num;}6、#includevoidtime(int,int);usingnamespacestd;intmain(){cout<<"Enterthenumberofhours:";inthours;cin>>hours;cout<<"Enterthenumberofminutes:";intminutes;cin>>minutes;time(hours,minutes);system("pause");return0;}voidtime(intnum1,intnum2){cout<6、<"Time:"<
2、endl;system("pause");return0;}3、#includevoidprint1(int);voidprint2(int);usingnamespacestd;intmain(){print1(2);print2(2);system("pause");return0;}voidprint1(intnum){for(inti=0;i3、yrun"<doublecen_to_Fah(double);intmain(){usingnamespacestd;cout<<"PleaseenteraCelsiusvalue:";doublevalue;cin>>value;cout<4、rn1.8*value+32.0;}5、#includedoubleLY_to_AU(double);intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_years;cout<5、AU(doublenum){return63240*num;}6、#includevoidtime(int,int);usingnamespacestd;intmain(){cout<<"Enterthenumberofhours:";inthours;cin>>hours;cout<<"Enterthenumberofminutes:";intminutes;cin>>minutes;time(hours,minutes);system("pause");return0;}voidtime(intnum1,intnum2){cout<6、<"Time:"<
3、yrun"<doublecen_to_Fah(double);intmain(){usingnamespacestd;cout<<"PleaseenteraCelsiusvalue:";doublevalue;cin>>value;cout<4、rn1.8*value+32.0;}5、#includedoubleLY_to_AU(double);intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_years;cout<5、AU(doublenum){return63240*num;}6、#includevoidtime(int,int);usingnamespacestd;intmain(){cout<<"Enterthenumberofhours:";inthours;cin>>hours;cout<<"Enterthenumberofminutes:";intminutes;cin>>minutes;time(hours,minutes);system("pause");return0;}voidtime(intnum1,intnum2){cout<6、<"Time:"<
4、rn1.8*value+32.0;}5、#includedoubleLY_to_AU(double);intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_years;cout<5、AU(doublenum){return63240*num;}6、#includevoidtime(int,int);usingnamespacestd;intmain(){cout<<"Enterthenumberofhours:";inthours;cin>>hours;cout<<"Enterthenumberofminutes:";intminutes;cin>>minutes;time(hours,minutes);system("pause");return0;}voidtime(intnum1,intnum2){cout<6、<"Time:"<
5、AU(doublenum){return63240*num;}6、#includevoidtime(int,int);usingnamespacestd;intmain(){cout<<"Enterthenumberofhours:";inthours;cin>>hours;cout<<"Enterthenumberofminutes:";intminutes;cin>>minutes;time(hours,minutes);system("pause");return0;}voidtime(intnum1,intnum2){cout<
6、<"Time:"<
此文档下载收益归作者所有