给定程序MODI1.C中函数fun的功能:先将s所指字

给定程序MODI1.C中函数fun的功能:先将s所指字符串中的字符按逆序存放到t所指字符中,然后把s所指串中的字符按正序连接到t所指串的后面。
例如:当s所指的字符串为:"ABCDE"时,则t所指的字符串应为:"EDCBAABCDE"。
请改正程序中的错误,使它能得出正确的结果。
注意:

不要改动main函数,不得增行或删行,也不得更改程序的结构!

/**********code.c**********/
#include<stdio.h>
#include<string.h>
void fun (char *s, char *t)
{
/**********found**********/
int i;
i=0;
sl = strlen(s);
for(; i<sl; i++)
/**********found**********/
t[i] = s[sl-i];
for(i=0; i<sl; i++)
t[sl+i] = s[i];
t[2*sl] = '\0';
}
main()
{
char s[100],t[100];
printf("\nPlease enter string s:"); scanf("%s", s);
fun(s,t);
printf("The result is: %s\n", t);
}
/**********-code.c**********/
答案
第1空:错误:int i; 正确:int i, sl;
第2空:错误:t[i] = s[sl-i]; 正确:t[i]=s[sl-i-1];

题目信息

题号:7637
题型:填空题
难度:普通