字符串替换--帮忙修改一下
#include<stdio.h>#include<string.h>
void main()
{
char s[30];
char str[] = "input";
void replace(char *s, char str[]);
clrscr();
printf("input a string:\n");
scanf("%s", s);
replace(s, str);
}
void replace(char *s, char *str)
{
int i, j;
if (strstr(s, str)!=NULL)
{
i = strstr(s, str);
s[i]= 's';s[++i] = 'h';
s[++i] = 'u';s[++i] = 'r';
s[++i] = 'u';
printf("%s", s);
}
else printf("no found");
}