Pagini recente » Cod sursa (job #1645771) | Cod sursa (job #1990230) | Cod sursa (job #884664) | Cod sursa (job #867827) | Cod sursa (job #2331007)
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
///memoria de date
char a[2000001],*p;
int i,nr,poz,sters;
int main()
{
///memoria stiva
int potrivire[1001];
char b[2000001];
f>>a>>b;int la=strlen(a);
while(strstr(b+i,a))
{
p=strstr(b+i,a);
poz=p-b;
potrivire[++nr]=poz;
i=poz+1;
if(nr==1000) break;
}
g<<nr<<'\n';
for(i=1;i<=nr;i++)
g<<potrivire[i]<<' ';
return 0;
}