是将字符串中的input改为shuru可是就是改不过来
#include<stdio.h>#include<string.h>
void main()
{
char s[30];
char *str = "input";
void replace(char s[30], char *str);
clrscr();
printf("input a string:\n");
scanf("%s", s);
replace(s, str);
}
void replace(char s[30], char *str)
{
int i, j;
if (strstr(s, str)!=NULL)
{
i = strstr(s, str);
s[i] = 's';s[i + 1] = 'h';
s[i + 2] = 'u';s[i + 3] = 'r';
s[i + 4] = 'u';
printf("%s", s);
}
else printf("no found");
}