C - primer - plus(第五版)习题答案(5)

2019-05-24 10:44

}

12.#include #define L 8

int Pow(int n);

int main(void) { }

int Pow(int n) { }

13.#include #define L 8

int main(void) {

double first[L], second[L]; int index;

printf(\,L); for(index = 0;index < L; index++)

scanf(\,&first[index]); for(index = 0;index < L; index++) int pow, i; pow = 1;

for(i = 1; i <= n; i++)

pow *= 2; return pow; return 0; int Array[L]; int index = 0;

for(index = 0; index < L; index++) { }

index = 0; do

printf(\,Array[index]); while(++index<8); printf(\);

Array[index] = Pow(index);//使用头文件#include ,Array[index] = pow(2,i); return 0;

}

printf(\,first[index]);

printf(\); second[0] = first[0];

for(index = 1;index < L; index++)

second[index] = second[index-1] + first[index]; printf(\,second[index]); for(index = 0;index < L; index++) return 0;

14.#include #define L 20

int main(void) { }

15.#include #define SM 100 #define K 0.1 #define L 0.05

int main(void) {

while(De <= Da) { }

printf(\,years,De,Da);

Da += SM * K; De += De * L; years++; int years = 0; double Da = SM; double De = SM; char string[L]; int index;

printf(\);

for(index = 0; index < L; index++)

scanf(\,&string[index]); printf(\);

for(index = L-1; index >= 0; index--)

return 0;

printf(\,string[index]); printf(\);

}

return 0;

16.#include

int main(void) { } 第七章 复习题:

1.false;true;false.

2.a.number >= 90 && number < 100 b.ch != ?q?&& ch != ?k?

c.number >= 1 && number <=8 && number != 5 d.number < 1 || number > 9 3.#include

int main(void) { }

4.a.1;b.0;c.1;d.6;3.10;f.0.

scanf(\, &weight, &height); if(weight < 100 && height > 64) { }

elseif(weight > 300 && height < 48)

printf(\); printf(\); else return 0;

if(height >= 72)

printf(\); printf(\); else

int weight, height; int years = 0; double Lucky = 1e6; while(Lucky > 0) { }

printf(\,years); return 0;

years++;

Lucky = Lucky+ Lucky*0.08 - 1e5;

5.*#%*#%$#%*#%*#%$#%*#%*#%$#%*#%*#% 6.fathatcatOh no! hatcatOh no! catOh no!

7.#include #include

int main(void) { }

8.重复打印:

You are 65.Here is your gold watch.

问题在于if(age = 65);应该写成if(65 == age) 9.q Step 1 Step 2 Step 3 c Step 1 g Step 1 Step 3 b Step 1 Done

10.#include

int main(void)

while((ch = getchar()) != '#') { }

printf(\,lc, uc, oc); return 0;

if(islower(ch))

lc++; uc++; oc++;

elseif(isupper(ch)) else char ch; int lc = 0; int uc = 0; int oc = 0;

{ } 编程练习

1.#include

int main(void) {

char ch; int cc = 0; int sc = 0; int nc = 0;

printf(\); while((ch = getchar()) != '#') { }

printf(\); printf(\,cc, sc, nc); printf(\); return 0;

cc++;

if(ch == ' ')

sc++; nc++;

elseif (ch == '\\n') char ch;

while((ch = getchar()) != '#') { }

printf(\); return 0;

if(ch != '\\n') { }

printf(\); if(ch == 'b') { }

break;

if(ch != 'g') printf(\); printf(\); elseif(ch != 'c')


C - primer - plus(第五版)习题答案(5).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:工作记录及成绩评定册:示例样本(含选题审批表、任务书、开题报

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: