为什么有一个是错的,大佬帮帮忙

[复制链接]
查看11 | 回复2 | 2021-1-27 05:22:06 | 显示全部楼层 |阅读模式
#include
intmain()
{
charstring[1000000],pattern[1000000];
intn;
scanf("%s",string);
scanf("%d",&n);
for(inti=0;i -->
回复

使用道具 举报

千问 | 2021-1-27 05:22:06 | 显示全部楼层
if(pattern[n]=='\0')
{
flag_1=1;
index=k;//这里加一句
break;
}
printf("%s",string+(index+1));这一句把index+1改成index
试试看对不对
回复

使用道具 举报

千问 | 2021-1-27 05:22:06 | 显示全部楼层
#include
charstring[1000000],pattern[1000000];
intmain()
{
intn;
inti,j,k;
#if1
scanf("%s",string);
scanf("%d",&n);

i=0;
while(i
供参考~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行