2022年C语言程序设计清华大学出版社第6章参考答案 .pdf

上传人:Q****o 文档编号:56643601 上传时间:2022-11-02 格式:PDF 页数:10 大小:36.75KB
返回 下载 相关 举报
2022年C语言程序设计清华大学出版社第6章参考答案 .pdf_第1页
第1页 / 共10页
2022年C语言程序设计清华大学出版社第6章参考答案 .pdf_第2页
第2页 / 共10页
点击查看更多>>
资源描述

《2022年C语言程序设计清华大学出版社第6章参考答案 .pdf》由会员分享,可在线阅读,更多相关《2022年C语言程序设计清华大学出版社第6章参考答案 .pdf(10页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。

1、习题6 一、程序阅读题1、以下程序运行后的输出结果是c。#include void fun(int x,int y,int z)z=x*x+y*y;void main()int a=31;fun(5,2,a);printf(%d,a);A、0 B、29 C、31 D、无定值2、以下程序运行后的输出结果是d。#include void f(int x,int y)int t;if(xy)t=x;x=y;y=t;void main()int a=4,b=3,c=5;f(a,b);f(a,c);f(b,c);printf(%d,%d,%dn,a,b,c);A、3,4,5 B、5,3,4 C、5,4,

2、3 D、4,3,5 3、以下程序运行后的输出结果是a。#include stdio.h#define FUDGE(y)2.84+y#define PR(a)printf(%d,(int)(a)#define PRINT1(a)PR(a);putchar(n)void main()int x=2;PRINT1(FUDGE(5)*x);A、12 B、14 C、16 D、18 4、以下程序的输出结果是 d。#include int k=1;void main()void Fun();int j;for(j=0;j 2;j+)Fun();printf(k=%d,k);void Fun()int k=1

3、;printf(k=%d,k);k+;A、k=1,k=2,k=3 B、k=1,k=2,k=1 C、k=1,k=1,k=2 D、k=1,k=1,k=1 5、以下程序的输出结果是 d。#include stdio.h int f()static int i=0;int s=1;s+=i;i+;return s;void main()int i,a=0;for(i=0;i5;i+)a+=f();printf(%dn,a);A、20 B、24 C、25 D、15 6、以下程序的输出结果是 b。#include int f(int n)if(n=1)return 1;else return f(n-1)

4、+1;void main()int i,j=0;for(i=1;i3;i+)j+=f(i);printf(“%dn”,j);A、4 B、3 C、2 D、1 二、程序填空题1、计算函数 F(x,y,z)=(x+y)/(x-y)+(z+y)/(z-y)的值。#include 文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码

5、:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4

6、Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码

7、:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4

8、Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码

9、:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4

10、Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1#include float f(float,float);void main floa

11、t x,y,z,sum;scanf(“%f%f%f“,&x,&y,&z);sum=f(b)+f(c);printf(“sum=%fn”,sum);float f(float a,float b)float value;value=a/b;return(value);A、x-y,x+y B、x+y,x-y C、z+y,z-y D、z-y,z+y A、x-y,x+y B、x+y,x-y C、z+y,z-y D、z-y,z+y 2、输入 1 个实数 m,根据以下公式,计算机满足精度m 要求的值,/2=1+1/3+(1/3)*(2/5)+(1/3)*(2/5)*(3/7)+(1/3)*(2/5)*(3

12、/7)*(4/9)+#include#include double pi(double p)double s,t;int n;for(b;tp;n+)s+=t;t=n*t/(2*n+1);return(c);void main()double m;printf(nPlease enter a precision:);scanf(%f&m);printf(nep=%f,=%f,m,pi(m);A、n=1 B、n=1,s=0,t=1 C、n=1,s=0 D、n=1,s=0,t=0 A、t B、s C、2*s D、2*t 3、输入 1 个正整数 n,计算并输出 s 的前n 项的和。文档编码:CV6W

13、5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8

14、ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W

15、5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8

16、ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W

17、5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8

18、ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W

19、5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1s=1/2-2/3+3/4-4/5+(-1)n-1 n/(n+1)#include void main()int n;float fun(int n);scanf(%d,&n);printf(sum=%fn,fun(n);float fun(int n)int k,flag=1;float s=0;for(k=1;k=n;k+)s=s+a;c;A、1.0*k/(k+1)*fl

20、ag B、flag*n/(n+1)C、-k/(k+1)D、1.0*k/(k+1)A、flag=-1 B、s=-s C、flag=-flag D、k=-k 4、输入一个整数,将它逆序输出。例如reverse(123)的返回值是 321。#include void main()long n;long reverse(long number);printf(Enter an integer:);scanf(%ld,&n);printf(After reversed:%ldn,c);long reverse(long number)int flag;c;flag=number 0 B、number 0

21、 C、number!=0 D、number=0 A、number%10 B、res*10+number%10 C、number/10 D、res*10+number/10 5、设有以下程序,为使之正确运行,请填入应包含的命令行。其中,tryme()函数在文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T

22、7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F

23、7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T

24、7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F

25、7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T

26、7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F

27、7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1d:myfile1.c 中有定义。#include _a_ main()printf(n);tryme()

28、;A、#included:myfile1.c B、#includemyfile1.c 6、求1 元2 次方程ax2+bx+c=0 的实根。#include#include float x1,x2;int f(float a,float b,float c)if(b*b-4*a*c0)return 1;x1=(-b+sqrt(b*b-4*a*c)/2/a;x2=(-b-sqrt(b*b-4*a*c)/2/a;_a_ void main()float a,b,c;scanf(%f,%f,%f,&a,&b,&c);if(_b_)printf(实数范围内无解 n);else printf(%.2f%.

29、2fn,x1,x2);A、return 0;B、return 1;A、f(a,b,c)=0 B、f(a,b,c)=1 7、验证哥德巴赫猜想:任何一个大于6 的偶数均可表示为两个素数之和。例如6=3+3,8=3+5,18=7+11。将6100 之间的每个偶数都表示成两个素数之和。#include stdio.h#include math.h void main()int i,k;int prime(int m);for(i=6;i=100;i=i+2)for(k=3;k=50;k+)if(c)printf(%d=%d+%dn,i,k,i-k);break;int prime(int m)int

30、k,n;文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8

31、 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4

32、S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8

33、 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4

34、S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8

35、 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4

36、S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C11 1 1 1 1.1 2 3 n k s=k n=+if(m=1)return 0;n=(int)sqrt(m);for(k=2;k=n;k+)b;b;A、prime(i)B、prime(i)&prime(k)C、prime(k)&prime(i-k)D、prime(k)A、if(m%k!=0)return 0 B、if(m%k=0)return

37、0 C、if(m%k=0)return 1 D、if(m%k!=0)return 1 A、return 0;B、return 1;C、else return 0;D、else return 1;三、编程题1、编写程序输出一张摄氏华氏温度转换表,摄氏温度的取值区间是-100,100 ,温度间隔 10。要求定义和调用函数 ctof(c),将摄氏温度 C 转换为华氏温度F,计算公式:F=32+C*9/5。2、编写程序计算排列数()!m n Pn m m-=。要求定义并调用函数 fact(n)计算n 的阶乘。3、编写程序计算并输出的值。要求定义并调用函数total(n)计算1+1/2+1/3+1/n。

38、4、编写程序计算 aaaaaaaa a(n 个a)之和。要求定义并调用函数 fn(a,n),它的功能是返回 aa a(n 个a)。例如,fn(3,2)的返回值是 33。5、编写程序求两个整数相除的余数。要求用带参的宏来实现。6、编写程序从 3 个输入的整数中找出最大数。要求用带参的宏来实现。7、编写程序找出并输出 11 至999 之间的数 m,它满足 m、m*m、m*m*m 均为回文数。所谓回文数是指各位数字左右对称,例如121、676 等。要求定义并调用函数JSValue(m)实现此功能,如果是回文数,则函数返回1,反之则返回 0。8、编写程序输出 m 和n 之间所有的 Fibonacci

39、数。要求定义并调用函数 fib(n),它的功能是返回第 n 项Fibonacci 数。例如,fib(7)的返回值是 13。文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C

40、1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF

41、6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C

42、1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF

43、6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C

44、1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF

45、6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C19、编写程序找出 1001000 之间的所有可逆素数。要求判断素数、颠倒顺序的功能分别用自定义函数来实现。(可逆素数是指一个素数的各位数值顺序颠倒后得到的数仍为素数。例如,113、311)。三、编程题1#include int ctof(

46、int a)return 32+a*9/5;void main()int i,n=1;for(i=-100;i=100;i=i+10)printf(%5d,ctof(i);if(n=5)n=0;printf(n);n+;2#include int fact(int a)int i,s=1;for(i=1;i=a;i+)s=s*i;return s;void main()int m,n,p;scanf(%d,%d,&m,&n);p=fact(m)/fact(m-n);printf(p=%dn,p);3#include float total(int a)int i;float s=0;for(i

47、=1;i=a;i+)s=s+1.0/i;return s;void main()int n;文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7

48、E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7

49、S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7

50、E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7S4S7C1文档编码:CV6W5E2T7E8 HF6M2Q4Y1U8 ZB4F7

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 高考资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号© 2020-2023 www.taowenge.com 淘文阁