
1个回答
展开全部
#include "stdio.h"
#include "conio.h"
main()
{
char* inputStr;
char* chPosi;
scanf("%s", inputStr);
chPosi = strstr(inputStr, "abc");
while(chPosi!=NULL)
{
while(*chPosi!=NULL)
{
*chPosi = *(chPosi+3);
chPosi++;
}
chPosi = strstr(inputStr, "abc");
}
printf("%s\n", inputStr);
getch();
}
#include "conio.h"
main()
{
char* inputStr;
char* chPosi;
scanf("%s", inputStr);
chPosi = strstr(inputStr, "abc");
while(chPosi!=NULL)
{
while(*chPosi!=NULL)
{
*chPosi = *(chPosi+3);
chPosi++;
}
chPosi = strstr(inputStr, "abc");
}
printf("%s\n", inputStr);
getch();
}
追问
好像编译不了。我用的是虚拟机。没有conio.h
追答
直接将#include "conio.h"删除吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询