好文档 - 专业文书写作范文服务资料分享网站

C primer plus(第五版)课后第四章编程练习答案

天下 分享 时间: 加入收藏 我要投稿 点赞

第四章 1.

#include int main(void) { }

char ming[20],xing[20];

printf(\); scanf_s(\, ming,20); scanf_s(\, xing,20);

printf(\, ming, xing); return 0;

2.

#include int main(void) { }

char name[40]; int width;

printf(\); scanf_s(\, name,40); printf(\, name); printf(\, name); printf(\, name); width = strlen(name) + 3; printf(\, width, name); return 0;

3.

#include int main(void) { }

float num;

printf(\); scanf_s(\, &num);

printf(\,num, num); printf(\, num, num); return 0;

4.

#include int main(void) { }

char name[40]; float height;

printf(\); scanf_s(\, name, 40, &height);

printf(\, name, height/12); return 0;

5.

#include int main(void) { }

printf(\, ming, xing); printf(\, b, b, a, a); return 0;

printf(\); scanf_s(\, ming, 40);

printf(\); scanf_s(\, xing, 40); a = strlen(xing); b = strlen(ming);

printf(\, ming, xing); printf(\, b, b, a, a); char xing[40], ming[40]; int a, b;

6.

#include #include int main(void) {

double a = 1.0/3.0; float b = 1.0/3.0;

printf(\, a, a, a); printf(\, b, b, b); printf(\, FLT_DIG);

}

printf(\, DBL_DIG); return 0;

7.

#include #define gallitre 3.785 #define mikm 1.609 int main(void) { }

double mile, petrol, milespergallon,LKM; printf(\); scanf_s(\, &mile); printf(\); scanf_s(\, &petrol); milespergallon = mile / petrol;

LKM = 100 * petrol * gallitre / (mile * mikm); printf(\, milespergallon); printf(\, LKM); return 0;

C primer plus(第五版)课后第四章编程练习答案

第四章1.#includeintmain(void){}charming[20],xing[20];printf(\);scanf_s(\,ming,20);scanf_s(\,xing,20);printf(\,ming,xing);return0;
推荐度:
点击下载文档文档为doc格式
9x95i5g9al48fsc2a7r62i4cx3q5al00q7i
领取福利

微信扫码领取福利

微信扫码分享