C语言程序设计江宝钏著清华大学出版社第6章参考(3)

时间:2025-02-21

#include<math.h>

float f(float,float);

void main ()

{

float x,y,z,sum;

scanf( “%f%f%f “,&x,&y,&z); sum=f( b )+f( c );

printf( “sum=%f\n ”,sum); }

float f(float a,float b) {

float value;

value =a/b;

return(value);

}

A 、 A 、

2、

(4/9 ) + …

#include<stdio.h> #include<math.h> double pi(double p) {

double s,t;

int n;

for( b ;t>p;n++)

{

s+=t;

t=n*t/(2*n+1);

}

return( c );

}

void main()

{

double m;

printf("\nPlease enter a precision:"); scanf("%f"&m);

prin tf("\ne p=%f, n =%f",m, pi( m));

}

A 、 A 、 3、 x-y, x+y

B 、x+y, x-y

C 、 z+y, z-y

D 、z-y, z+y

x-y, x+y B 、x+y, x-y C 、 z+y, z-y D 、z-y, z+y 输入1个实数m,根据以下公式,计算机满足精度 m 要求的n 值,

n /2=1+1/3+( 1/3)*( 2/5)+( 1/3)*(2/5)*(3/7)+( 1/3)* (2/5)*(3/7) n=1 B 、n=1,s=0,t=1 C 、 n=1,s=0 D 、n=1,s=0,t=0 t B 、s C 、2*s D 、2*t 输入1个正整数n,计算并输出s 的前n 项的和。

C语言程序设计江宝钏著清华大学出版社第6章参考(3).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

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