c程序设计教程与实验 实验七 吉顺如.docxVIP

  • 29
  • 0
  • 约2.08千字
  • 约 5页
  • 2018-01-10 发布于河南
  • 举报

c程序设计教程与实验 实验七 吉顺如.docx

c程序设计教程与实验 实验七 吉顺如

C程序设计教程与实验实验七 吉顺如Sy7_1:#includestdio.h#includestring.hvoid sub(char s[],char t[]){int i,d;d=strlen(s);for(i=1;id;i++)t[i]=s[d-1-i];for(i=0;id;i++)t[d+i]=s[i];t[2*d]=\0;}main(){char s[100],t[100];printf(Please enter string s:);scanf(%s,s);sub(s,t);printf(\n The result is :%s\n,t);}Sy7_2:#includestring.h#includestdio.h#define ARR_SIZE 80void Inverse(char str[]);main(){char a[ARR_SIZE];printf(Please enter a string:);gets(a);Inverse(char a[]);printf(The inverse string is:);puts(s);}void Inverse(a){int len,i=0,j;char temp;len=strlen(str);for(j=len-1;ij;i++,j--){ temp=str[i]; str[i]=str[j]; str[j]=t

文档评论(0)

1亿VIP精品文档

相关文档