下面函数的功能是将两个字符串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;}
写出下面程序执行后的运行结果。 #include #include using namespace std;void sort____{int i, j, k; char*t;for ____ {k = i;for ____if ____<0) k = j;if ____ { t = a[i]; a[i] = a[k]; a[k] = t; }}}void main____{char ch[4][15] = { "morning","afternoon","night","evening"};char *name[4]; int k;for ____ name[k] = ch[k];sort____;for ____ cout << name[k] << endl;}