正在加载图片...
#include ' stdio. h"t maino i print("In How do you do! In") print(char *string (34) if(str= (35) return while(str)str++ 。/oc str); *strNULL (36) 5下列程序是将字符串tmp后移 length个位置,移出的字符移到串首。请完善程序 #include stdio. h" mainO i void backmoveO char temp[81; int length=3: gets(temp); backmove(temp, length); printf("%sIn", temp); void backmove(x, m) d int i, j, n; n=strlen(x); forgj=0; j<m: j++) for(i=0; i<n-1; i++) +n-1-i) (38) *xch 6.以下程序把从键盘输入的字符存放到一个文件中,用'#作为结束符请按题意要求 填空完普程序。 #include <stdio. h> maIn f FILE"fp; har ch, fname[ 10#include "stdio.h" main() { print("\n How do you do! \n"); } print(char *string) { char *str= (34) ; if(*str== (35) ) return; while(*str)str++; --str; printf("%c",*str); *str=NULL; print( (36) ); } 5.下列程序是将字符串 temp 后移 length 个位置,移出的字符移到串首。请完善程序。 #include "stdio.h" #include "string.h" main() { void backmove(); char temp[81]; int length=3; gets(temp); backmove(temp,length); printf("%s\n",temp); return; } void backmove(x,m) char *x; int m; { int i,j,n; char ch; n=strlen(x); for(j=0;j<m;j++) { ch= (37) ; for(i=0;i<n-1;i++) *(x+n-1-i)= (38) ; *x=ch; } } 6.以下程序把从键盘输入的字符存放到一个文件中,用 ' # ' 作为结束符.请按题意要求 填空完善程序。 #include <stdio.h> main() { FILE *fp; char ch,fname[10];
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有