C模拟考试一.pptVIP

  • 5
  • 0
  • 约小于1千字
  • 约 32页
  • 2018-11-16 发布于河北
  • 举报
C模拟考试一.ppt

C模拟考试一 2005年6月 登录界面 题型 选择题 填空题 判断题 分析程序运行结果 程序修改:在k:\下有程序源文件m.c,程序功能:把在字符串s中出现的每个字符, 紧随其后重复出现一次,放在一个新串t中。 例如:当s字符串为:ABCDE时,则t字符串应为:AABBCCDDEE。 请改正函数fun中的错误,使它能得出正确的结果。(15分) # include stdio.h main() { int a=25,b=14,c=19; if (a++=25 b--=2 c++) printf(***a=%d,b=%d,c=%d\n,a,b,c); else printf(###a=%d,b=%d,c=%d\n,a,b,c); } ###a=26,b=13,c=19 #include stdio.h #include string.h void fun (char *s, char *t) { int i, sl; sl = strlen(s); /************found************/ for (i=0; isl; i++) { t[2*i] = s[i]; /************found************/ t[2*i

文档评论(0)

1亿VIP精品文档

相关文档