三车资料库

QQ登录

只需一步,快速开始

注册

— — — — — — — —下载区开始线 — — — — — — — —  
《C++程序设计》课后习题答案(第2版,吴乃陵,高教版).rar

《C++程序设计》课后习题答案(第2版,吴乃陵,高教版).rar [470.57 KB]

— — — — — — — —下载区结束线 — — — — — — — —  
《C++程序设计》课后习题答案(第2版,吴乃陵,高教版) - 三车资料库 - 1.jpg


第一章 C++基础知识习题

1.1
判断下列标识符的合法性。

sin
book
5arry
_name
Example2.1
main

$1
class_cpp
a3
x*y
my name


答:合法的:sin
book
_name
class_cpp
a3

    非法的:5arry
Example2.1
$1
x*y
my name

1.2 假定有下列变量:
int a=3,b=5,c=0;
float x=2.5,y=8.2,z=1.4;
char ch1=’a’,ch2=’5’,ch3=’0’,ch4;
求下列表达式的值,以及运算后表达式所涉及的各变量的值。
x+(int)y%a
x=z*b++,b=b*x,b++
ch4=ch3-ch2+ch1

int(y/z)+(int)y/(int)z
!(a>b)&&c&&(x*=y)&&b++

ch3||(b+=a*c)||c++
z=(a<<2)/(b>>1)


答:x+(int)y%a 值为:4.5

x=z*b++,b=b*x,b++ 值为:42x7b43
ch4=ch3-ch2+ch1 值为:’\\’
int(y/z)+(int)y/(int)z 值为:13
!(a>b)&&c&&(x*=y)&&b++ 值为:0b5
注:只要出现一个false右边的不再做。

ch3||(b+=a*c)||c++ 值为:1c0
注:只要出现一个true,右边不再做。

z=(a<<2)/(b>>1) 值为:6
yujie2ll 发表于 2011-3-18 18:23:18
我要資料  謝謝·········

三车资料库

三车资料库|Archiver|法律顾问:ITLAW-庄毅雄律师|联系我们  

Copyright © 2009 - 2011 三车资料库 (湘ICP备11018236号) All rights reserved.

Powered by Discuz! X2. 掘墓网.

GMT+8, 2012-5-20 07:56 , Processed in 0.098576 second(s), 26 queries .