Pagini recente » Cod sursa (job #553561) | Cod sursa (job #705639) | Cod sursa (job #1041817) | Cod sursa (job #2784939) | Cod sursa (job #539002)
Cod sursa(job #539002)
#include <cstdio>
#include <string>
using namespace std;
char s[2000001],c[2000001],*p;
int a[1001],n;
int main(){
freopen("strmatch.in","r",stdin);
freopen("strmatch.out","w",stdout);
scanf("%s%s",&s,&c);
p=strstr(c,s);
while (p){
++n;
if (n<1000) a[n]=p-c;
p=strstr(p+1,s);
}
printf("%d\n",n);
if (n>1000) n=1000;
for(int i=1;i<=n;++i)
printf("%d ",a[i]);
return 0;
}