早教吧 育儿知识 作业答案 考试题库 百科 知识分享

程序填空以下程序的功能:将s所指字符串的正序和反序进行连接,形成一个新串放在t所指的数组中.程序填空---------------------------------------------------------题目:以下程序的功能:将s

题目详情
【程序填空】以下程序的功能:将s所指字符串的正序和反序进行连接, 形成一个新串放在t所指的数组中.
【程序填空】
---------------------------------------------------------
题目:以下程序的功能:将s所指字符串的正序和反序进行连接,
形成一个新串放在t所指的数组中.
例如:当s串为"ABCD"时,则t串的内容应为"ABCDDCBA".
-------------------------------------------------------*/
#include
#include
#include
void fun (char *s, char *t)
{
int i, d;
//
t[【?】] ='\0';
}
main()
{
char s[100], t[100];

printf("\nPlease enter string S:"); scanf("%s", s);
fun(s, t);
printf("\nThe result is: %s\n", t);
}
▼优质解答
答案和解析
#include #include #include void fun (char *s, char *t){ int i, d;// t[【?】] ='\0';填:t[2*d]='\0',为数组t在最后的一个元素后面附加一个结束符}main(){ char s[100], t[100]; printf("\nPleas...