您好,欢迎访问三七文档
当前位置:首页 > IT计算机/网络 > 计算机应用/办公自动化 > 技能高考专题:C++习题参考答案
C++11233=+=+451BA.B.C.D.2CA.B.C.D.3DA.B.C.D.4CA.B.C.D.5C++CDA.CC++B.CC++C.C++CD.C++CCC++C6AA.B.C.D.7AA.B.C.D.=++++8BCA.B.C.D.9ADA.B.C.D.12C++C++3456C++JavaJava7C++C++8C++12=+32CC++inline1C++2C++///*,,*/3C++iostream4cin5cout67C++&89C++10inline11newdelete12x=10y=10x=100y=100#includeiostreamusingnamespacestd;intmain{intx=10&y=x;coutx=xy=yendl;int*p=&y;*p=100;coutx=xy=yendl;return0;}1p2p3AA.intp1*p2p3;B.int*p2p1*p3;C.intp1*p2=&p1*p3;D.int*p2p1*p3=&p1;*1*2,;2doublexx=3.14*pp=&xx*ppDA.&xxB.*xxC.3.14D.xxppxx*ppxx3CA.B.C.D.4AA.voidB.intC.D.float5DA.B.C.D.6DA.B.C.D.7DA.B.C.D.C++8CA.B.switchC.D.9AA.B.C.D.10C++CCDA.B.C.D.=++++1C++2constconstint345678newdelete12C++34inlineswitchwhile1~556#includeiostreamusingnamespacestd;intmain{intnum=50;int&ref=num;ref=ref+10;coutnum=numendl;num=num+40;coutref=refendl;return0;}num=60ref=100intnum50intrefnumnumref50C++powxyxycmathpowxycmathxyxyxy//xt2_1.cpp#includeiostream#includecmathusingnamespacestd;intmain{floatxy;coutpleaseinput2floatstoxy:;cinxy;floatz=powxy;coutpowxy=zendl;return0;}pleaseinput2floatstoxy:3.12pow3.12=9.6131privatepublicprotectedprivatepublic2MyClassMyClass34DcDca10b2111010b111516delete7C++489101112ABBfriendclassA1BA.publicB.staticC.protectedD.privatepublicprotectedprivate2BCA.B.C.D.publicprotectedprivateprivate3CA.B.privateprotectedC.publicD.publicprivatepublic4CA.B.C.D.C++5MClassddppddccddddBppDccBA.B..C.&D.-6CA.B.C.D.7BA.B.C.D.void8AAab3*pBA.1B.2C.3D.49ACA.B.C.D.10DA.B.C.D.11BCA.B.C.D.12CA.B.C.D.13thisBA.thisB.thisC.thisD.thisthisC++thisthis14BA.B.C.D.15newBA.B.C.D.deletenewnew16deleteDA.newB.newC.D.newdeletenew117CA.B..C.D.18CDA.B.C.thisD.thisthis19DA.B.C.D.this20AA.B.C.D.21AA.friendclassB.youyuanclassC.classfriendD.friendsclass22DA.friendB.C.D.thisthis23CA.B.C.D.12class{public:protected:private:};3publicprotectedprivate34thisthisC++thisthis5const31#includeiostreamusingnamespacestd;classTest{private:intnum;public:Test;//Testintn;//};TestTest{coutInitdefaendl;num=0;}TestTestintn{coutInitnendl;num=n;}intmain{Testx2;//1Testy15;//2return0;}InitdefaInitdefaInit152xy21xx2122y32#includeiostreamusingnamespacestd;classXx{private:intnum;public:Xxintx{num=x;}//~Xx{coutdstnumendl;}//};intmain{Xxw5;//1coutExitmainendl;//2return0;}Exitmaindst5w1wnum521w233.10WholeclassWhole{public:Wholeinti;//WholeWhole{};//Whole~Whole;//Wholeprivate:Partp1;//1Partp2;//2Partp3;//3};WholeWholeinti:p2ip1{coutConstructorofWholeendl;}Whole~Whole{coutDestructorofWholeendl;}DefaultconstructorofPartConstructorofPart3DefaultconstructorofPartConstructorofWholeDestructorofWholeDestructorofPart0DestructorofPart3DestructorofPart0XXXXWholePart3p1p2p3p1p2p3Wholewp1p2p3p1WholePartp2p3Wholep3Partw444#includeiostreamusingnamespacestd;classBook{public:Bookintw;staticintsumnum;private:intnum;};BookBookintw{num=w;sumnum-=w;}intBooksumnum=120;//1intmain{Bookb120;//2Bookb270;//3coutBooksumnumendl;return0;}301sumnumsumnum1202sumnum1003sumnum301CircleradiusareaCircleradius
本文标题:技能高考专题:C++习题参考答案
链接地址:https://www.777doc.com/doc-8527832 .html