实验一Word文档格式.docx
- 文档编号:19375621
- 上传时间:2023-01-05
- 格式:DOCX
- 页数:11
- 大小:77.10KB
实验一Word文档格式.docx
《实验一Word文档格式.docx》由会员分享,可在线阅读,更多相关《实验一Word文档格式.docx(11页珍藏版)》请在冰豆网上搜索。
<
"
This"
is"
;
a"
C++"
program."
endl;
return0;
}
6.分析下面程序运行的结果(计算10+23)
inta,b,c;
a=10;
b=23;
c=a+b;
a+b="
c;
7.分析下面程序的运行结果。
(比较三个数中的最小数)
intf(intx,inty,intz);
cin>
>
a>
b>
c=f(a,b,c);
c<
intf(intx,inty,intz)
intm;
if(x<
y)m=x;
elsem=y;
if(z<
m)m=z;
return(m);
8.在你所用的C++系统上,输入以下程序,进行编译,观察编译情况,如果有错误,请修改程序,再进行编译,直到没有错误,然后进行连接和运行,分析运行结果。
(计算a+b)
b;
9.在你所用的C++系统上,输入以下程序,进行编译,观察编译情况,如果有错误,请修改程序,再进行编译,直到没有错误,然后进行连接和运行,分析运行结果。
intadd(intx,inty);
c=add(a,b);
intadd(intx,inty)
intz;
z=x+y;
return(z);
10.输入以下程序,编译并以运行,分析运行结果。
(三个数以从小到大排列)
voidsort(intx,inty,intz);
intx,y,z;
cin>
x>
y>
z;
sort(x,y,z);
voidsort(intx,inty,intz)
inttemp;
if(x>
y){temp=x;
x=y;
y=temp;
x)cout<
z<
'
'
x<
y<
elseif(z<
y)cout<
elsecout<
第二章
3.写出以下程序运行的结果。
charc1='
a'
c2='
b'
c3='
c'
c4='
\101'
c5='
\116'
cout<
c1<
c2<
c3<
\n'
\t\b"
c4<
\t'
c5<
return0;
4.写出以下程序运行的结果。
charc1='
C'
c2='
+'
c3='
cout<
"
Isay:
\"
<
c1<
c2<
c3<
'
\t\t"
Hesays:
C++isveryinsteresting!
7.写出程序运行的结果。
inti,j,m,n;
i=8;
j=10;
m=++i+j++;
n=(++i)+(++j)+m;
i<
j<
m<
n<
8.将China译成密码。
c2='
h'
i'
n'
c1+=4;
c2+=4;
c3+=4;
c4+=4;
c5+=4;
passwordis"
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 实验