全文预览

C语言程序设计基础

上传者:你的雨天 |  格式:pdf  |  页数:89 |  大小:5963KB

文档介绍
aluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rif(bits[i]=='O')bits[i]='l';\relsebreak;\r)\rfor(i=15;i>=0;i-)\r{\rif(bits[i]=='l')bits[i]='O';\relsebits[i]='l';\r)\rreturnbits;}\rbinary::operatorint()\r{\runsignedvalue=O;\rfor(inti=0;i<=15;i++)\rvalue=(value*2)+(bits[i]=='0'?0:l);\rreturnvalue;}\rvoidbinary::print()\r{\rcharstr[17];\rstrncpy(str,bits,16);\rstr[16]='\0';\rcout<<str<<"\n";}\rmain()\r{\rbinarynl="1011";\rbinaryn2=int(nl)+8;\rbinaryn3=n21n1;\rbinaryn4=nl&n2;\rbinaryn5="101011";\r~n5;\rnl.print();EvaluationWarning:ThedocumentwascreatedwithSpire.PDFfor.NET.\rn2.print();\rn3.print();\rn4.print();\rn5.print();\rcout<<int(n2)+5<<endl;\rcout<<n2-binary(5)<<endl;\rcout<<n3+binary(5)<<endl;\rcout<<int(n3)-5<<endl;\rgetch();\rreturn1;\r)\r9. 0\r8\r10.`p?\ruvwC++??ãxyzß{

收藏

分享

举报
下载此文档