欢迎来到天天文库
浏览记录
ID:55895573
大小:871.50 KB
页数:197页
时间:2020-06-13
《C++-primer-plus(第6版)中文版-编程练习问题详解(word版).doc》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、第二章:开始学习C++//ex2.1--displayyournameandaddress#includeintmain(void){usingnamespacestd;cout<<"MynameisliaochunguangandIliveinhunanchenzhou.”;}//ex2.2--convertthefurlongunitstoyarduints-把浪单位换位码单位#includedoublefur2yd(double);intmain(){usingnamespaces
2、td;cout<<"enterthedistancemeasuredbyfurlongunits:";doublefur;cin>>fur;cout<<"convertthefurlongtoyard"<voidmice();void
3、see();usingnamespacestd;intmain(){mice();mice();see();see();return0;}voidmice(){cout<<"threeblindmice"<intmain(){usingnamespacestd;cout<<"Enteryourage:";intage;cin>>age;intmonth;month=age*12;cout<<
4、age<<"yearsis"<doubleC2F(double);intmain(){usingnamespacestd;cout<<"pleaseenteraCelsiusvalue:";doubleC;cin>>C;doubleF;F=C2F(C);cout<5、hrenheit."<doubleconvert(double);//函数原型intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_ye6、ars;doubleastro_units;astro_units=convert(light_years);cout<voidshow();main(){usingnamespacestd7、;show();return0;}voidshow(){usingnamespacestd;inth,m;cout<<"enterthenumberofhours:";cin>>h;cout<<"enterthenumberofminutes:";cin>>m;cout<<"Time:"<constintinch_per_feet=12;//const常量--1feet=12inch8、es--1英尺=12英寸intmain(){usingnamespacestd;cout<<"pleaseenteryourheightininches:bbb";//b表示为退格字符intht_inch;cin>>ht_inch;inth
5、hrenheit."<doubleconvert(double);//函数原型intmain(){usingnamespacestd;cout<<"Enterthenumberoflightyears:";doublelight_years;cin>>light_ye
6、ars;doubleastro_units;astro_units=convert(light_years);cout<voidshow();main(){usingnamespacestd
7、;show();return0;}voidshow(){usingnamespacestd;inth,m;cout<<"enterthenumberofhours:";cin>>h;cout<<"enterthenumberofminutes:";cin>>m;cout<<"Time:"<constintinch_per_feet=12;//const常量--1feet=12inch
8、es--1英尺=12英寸intmain(){usingnamespacestd;cout<<"pleaseenteryourheightininches:bbb";//b表示为退格字符intht_inch;cin>>ht_inch;inth
此文档下载收益归作者所有