C语言程序设计王玉第五章数组课件教学.pptVIP

  • 21
  • 0
  • 约7.06千字
  • 约 56页
  • 2017-01-02 发布于未知
  • 举报

C语言程序设计王玉第五章数组课件教学.ppt

#include stdio.h main() { char c,string[80]; int i,num=0,word=0; gets(string); for(i=0;(c=string[i])!=\0;i++) if(c== ) word=0; else if(word==0) { word=1; num++;} printf(There are %d word in the line.\n,num); } 下面程序的运行结果是 #include”stdio.h” #include”string.h” main() {char a[10]=“AB”,b[10]=“LMNP”; int i=0; strcat(A,B); while(a[i++]!=‘\0’) b[i]=a[i]; puts(b); } (a)LB (b )ABLMNP ( c)AB (d)LBLMNP 写出运算结果 #includestdio.h #includestring.h void main() { char c,*a=”Office”; int i; for (i=0;istrlen(a)/2;i++){ c=*a;strcpy(a,a+1);

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档