📄 right1-5.htm
字号:
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>第 1 章</title>
<base target="rbottom">
<style>
<!--
.右标题 { font-size: 10pt; color: #000080; text-indent: 0; margin: 0 }
.右内容 { font-size: 10pt; text-align: left; text-indent: 0; line-height: 100%; margin:
0 }
-->
</style>
</head>
<body>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"><span style="position: absolute; left: 4; top: -8"><img border="0" src="1.gif" width="63" height="70"></span></p>
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> </p>
<p style="line-height: 100%; text-indent: 0; margin: 0" class="右标题" align="left">
<span style="background-color: #CCFF99">第 1 章</span><span style="background-color: #CCFF99">
</span>><span style="background-color: #CCFF99"> 第 1 节 </span>><span style="background-color: #CCFF99">
1.5 习题</span></p>
<hr color="#008000" size="1">
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">1.
C++<font FACE="??ì?,SimSun" LANG="ZH-CN">语言源程序由什么构成?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">2.
C++<font FACE="??ì?,SimSun" LANG="ZH-CN">语言中使用的标识符有哪些规定?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">3.
C++<font FACE="??ì?,SimSun" LANG="ZH-CN">语言中有哪几种常量?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">4.
C++<font FACE="??ì?,SimSun" LANG="ZH-CN">程序中注释的方式有哪两种?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">5.
<font FACE="??ì?,SimSun" LANG="ZH-CN">整型(</font>int<font FACE="??ì?,SimSun" LANG="ZH-CN">)数据、长整型(</font>long<font FACE="??ì?,SimSun" LANG="ZH-CN">)数据、无符号整型(</font>unsigned<font FACE="??ì?,SimSun" LANG="ZH-CN">)数据在内存中占用的字节数和数值范围是多少?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">6.
<font FACE="??ì?,SimSun" LANG="ZH-CN">单、双精度类型的有效数字位是多少?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">7.
<font FACE="??ì?,SimSun" LANG="ZH-CN">字符常量</font>'A'<font FACE="??ì?,SimSun" LANG="ZH-CN">和字符串常量</font>"A"<font FACE="??ì?,SimSun" LANG="ZH-CN">在内存中存放有何区别?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">8.
<font FACE="??ì?,SimSun" LANG="ZH-CN">运算符的优先级和结合性指的是什么?</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">9.
<font FACE="??ì?,SimSun" LANG="ZH-CN">设整数</font>42865<font FACE="??ì?,SimSun" LANG="ZH-CN">,请定义一个整型变量和一个无符号整型变量存放此数,并以分别八进制、十进制、十六进制输出这两个变量,观察结果并解释。</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">10.
<font FACE="??ì?,SimSun" LANG="ZH-CN">请编程定义一个常量(两种方法)</font>PI<font FACE="??ì?,SimSun" LANG="ZH-CN">,表示圆周率,输入半径,求圆的周长和面积,要求周长输出时的宽度为</font>12<font FACE="??ì?,SimSun" LANG="ZH-CN">(左对齐),小数点后保留</font>2<font FACE="??ì?,SimSun" LANG="ZH-CN">位;面积输出时的宽度</font>15<font FACE="??ì?,SimSun" LANG="ZH-CN">(右对齐),小数点后保留</font>5<font FACE="??ì?,SimSun" LANG="ZH-CN">位。</font></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">11.
<font FACE="??ì?,SimSun" LANG="ZH-CN">请指出下面程序的运行结果。</font></font></p>
<blockquote>
<blockquote>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">#include
<iostream.h></font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">void
main( )</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">{
int a=3, b=2, c=1;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">int
d,logic;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">d=a++;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">cout<<"a="<<a<<",d="<<d<<endl;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">d=++b;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">cout<<"b="<<b<<",d="<<d<<endl;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">b*=a+c;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">cout<<a<<","<<b<<","<<c<<endl;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">b=2;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">logic=a>b;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">cout<<"logic="<<logic<<endl;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">logic=(c<a)||(c<b);</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">cout<<"logic="<<logic<<endl;</font></p>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">}</font></p>
</blockquote>
</blockquote>
<p ALIGN="justify" style="line-height: 100%; margin-top: 0; margin-bottom: 0"><font size="2">12.
<font FACE="??ì?,SimSun" LANG="ZH-CN">举例说明类型转换的两种形式。</font></font></p>
<hr size="1" color="#008000">
<p style="line-height: 100%; margin-top: 0; margin-bottom: 0"> <span style="position: absolute; left: 40; top: 610"><a href="right1-4.htm" target="_self"><img border="0" src="rightd1.gif" width="113" height="70"></a></span>
<span style="position: absolute; left: 493; top: 613"><a href="right2-1.htm" target="_self"><img border="0" src="rightd2.gif" width="124" height="63"></a></span></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -