Pagini recente » Cod sursa (job #1460897) | Cod sursa (job #384747) | Cod sursa (job #863406) | Cod sursa (job #2649062) | Cod sursa (job #2331006)
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
char a[2000001],*p;
int i,nr,poz,sters;
int main()
{
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;
}
g<<nr<<'\n';
for(i=1;i<=nr;i++)
g<<potrivire[i]<<' ';
return 0;
}