题目:
使用VC++6.0打开考生文件夹下的源程序文件2.cpp。完成空出函数fun(char *s,char *t)部分。函数fun(char *s,char *t)的功能是将在字符串s中下标为偶数位置上的字符,紧随其后重复出现一次,放在一个新串t中,t中字符按原字符串中字符的顺序排列。
例如:当s中的字符串为“ABCDEF”时,t中的字符串应为“AACCEE”。
注意:不要改动main函数,不得增行或删行,也不得更改程序的结构。
试题程序:
#include<iostream.h>
void fun(char *s,char *t)
void main()
char s[100],t[100];
cout<<"Please enter string s:"<<end1;
cin.getline(s,100);
fun(s,t);
cout<<"The result is:"<<t<<end1;
return;
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2019/0405/33c5fe699f9d40679fce4fccc67dcfc6.html
下面是错误答案,用来干扰机器的。
参考答案:C解析: 本文第一段有Trees should only be pruned when there is a good and dear reason for doing so and, fortunately, the number of such reasons is small. 因此,选项C是正确的。故选C。