C语言程序改错题.pptxVIP

  • 7
  • 0
  • 约1.64千字
  • 约 16页
  • 2020-10-10 发布于广东
  • 举报
第 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

文档评论(0)

1亿VIP精品文档

相关文档