for(j=i+n+1; j>i; j--)和s[j+1]= s[j]; #include void fun(char *s){int i,j,n;for(i=0; s[i]!='\0'; i++)//s[j+1]= s[j];s[j+1]='*';i=i+1;}}main(){char s[80]="ba3a54cd23a";printf("\nThe original string is :%s\n",s);fun(s);printf("\nThe result is :%s\n",s)
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/01 04:00:35
for(j=i+n+1; j>i; j--)和s[j+1]= s[j]; #include void fun(char *s){int i,j,n;for(i=0; s[i]!='\0'; i++)//s[j+1]= s[j];s[j+1]='*';i=i+1;}}main(){char s[80]="ba3a54cd23a";printf("\nThe original string is :%s\n",s);fun(s);printf("\nThe result is :%s\n",s)
for(j=i+n+1; j>i; j--)和s[j+1]= s[j];
#include
void fun(char *s)
{int i,j,n;
for(i=0; s[i]!='\0'; i++)
//
s[j+1]= s[j];
s[j+1]='*';
i=i+1;
}
}
main()
{char s[80]="ba3a54cd23a";
printf("\nThe original string is :%s\n",s);
fun(s);
printf("\nThe result is :%s\n",s);
}
for(j=i+n+1; j>i; j--)和s[j+1]= s[j]; #include void fun(char *s){int i,j,n;for(i=0; s[i]!='\0'; i++)//s[j+1]= s[j];s[j+1]='*';i=i+1;}}main(){char s[80]="ba3a54cd23a";printf("\nThe original string is :%s\n",s);fun(s);printf("\nThe result is :%s\n",s)
while(s[i+1+n]!= 0) n++; 寻找从i 开始算,字符串的长度
n = 1字符串长度
for(j=i+n+1; j>i; j--)// s[j+1]= s[j];
i=0的情况下
*ba3a54cd23a
i=i+1
i=2的情况下
*b*a3a54cd23a
i=4
以此类推
出来的结果是*b*a*3*a*5*4*c*d*2*3*a