题目内容

下面函数的功能是根据公式s=l-1/3+1/5-1/7+...+(-1n )/(2*n+1)计算s,计算结果通过形参指针sn传回。n通过形参传入,n的值大于等于0。请填空使程序完整、正确。void fun(float *sn,int n){ float s=0.0,w,f=-1.0;int i=0;for(i=0;i<=n;i++){f=(1____)=s;}

查看答案
更多问题

下面函数的功能是将两个字符串s1和s2连接起来。请填空使程序完整、正确。 void conj (char *s1,char *s2) { char *p=sl; while (*s1) (1____); s1++, s2++; }*s1=' \0'; }

写出下面程序执行后的运行结果。 #include #include using namespace std;void swapl____{int t;t = c0[0]; c0[0] = cl[0]; cl[0] = t;}void swap2____{int t;t = *c0; *c0=*cl; *cl = t;}void main____{int a[2] = { 3, 5 }, b[2] = { 3, 5 };swapl____; swap2____;cout << setw____ << a[0];cout << setw____ << a[1];cout << setw____ << b[0];cout << setw____ << b[1];}

写出下面程序执行后的运行结果。 #include using namespace std;void main____{char*p="abcdefgh",*r;long * q;q = ____p;q++;r = ____q;cout << r;}

读程序写运行结果。 #include using namespace std;template < class T>void f____ {int k;T t;for ____{k = i;for ____if ____ k=j;t = a[i], a[i] = a[k], a[k] = t;}}void main____{double d[5] = { 12.3, 4.5, -23.4, -90.4, 0 };char a[5] = { 'B', 'F', 'A', 'X', 'E' };f____;f____;for ____cout << d[i] << "..." << a[i] << endl;}

答案查题题库