问答题
【参考答案】
int jsSort()
{
int i,cnt=0,j;
Data ch;......
(↓↓↓ 点击下方‘点击查看答案’看完整答案、解析 ↓↓↓)
点击查看答案&解析
<上一题
目录
下一题>
热门
试题
填空题
给定程序中,函数fun的功能是计算下式直到,并把计算结果作为函数值返回。例如:若形参e的值为1e-3,函数的返回值为0.551690。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。不得增行或删行,也不得更改程序的结构!给定源程序:#include<stdio.h>double fun(double e){ int i, k; double s, t, x;s=0; k=1; i=2; **********found********** x=______ 4; **********found********** while(x______e){ s=s+k*x;k=k*(-1);t=2*i; **********found********** x=______ (t*t);i++;}return s;}main(){ double e=1e-3;printf( nThe result is:%f n , fun(e));}
点击查看答案
填空题
给定程序中函数fun的功能是:求出以下分数序列的前n项之和。和值通过函数值返回到main函数。例如,若n=5,则应输出:8.391667。请改正程序中的错误,使它能计算出正确的结果。注意:不要改动main函数,不得增行或删行,也不得更改程序的结构!给定源程序:#include<stdio.h> **********found********** void fun(int n){ int a, b, c, k; double s;s=0.0; a=2; b=1;for(k=1; k<=n; k++){ **********found********** s=s+(Double)a b;c=a; a=a+b; b=c;}return s;}main(){ int n=5;printf( nThe value of function is:%lf n , fun(n));}
点击查看答案
相关试题
Facing cheaper brands, Samsung feel...
Which of the following is suggested...
What can we infer from the last p...
评标委员会在对投标文件进行评审过程中,某...
当屋面坡度达到______时,卷材必须采...