- 13
- 0
- 约1.61万字
- 约 18页
- 2019-12-02 发布于天津
- 举报
PAGE 16
第1题 【程序改错】
功能:先将在字符串s中的字符按逆序存放到t串中,然后把s中的
字符按正序连接到t串的后面。
例如:当s中的字符串为:“ABCDE”时,则t中的字符串应为:
“EDCBAABCDE”。
*/
#include conio.h
#include stdio.h
#include string.h
void fun (char *s, char *t)
{
/**********FOUND**********/
int i;
sl = strlen(s);
for (i=0; isl; i++)
/**********FOUND**********/
t[i] = s[sl-i];
for (i=0; isl; i++)
t[sl+i] = s[i];
/**********FOUND**********/
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,
原创力文档

文档评论(0)