Pagini recente » Cod sursa (job #1238876) | Cod sursa (job #2065714) | Cod sursa (job #1353946) | Cod sursa (job #2010319) | Cod sursa (job #2573668)
#include <bits/stdc++.h>
#include <cstring>
# define pb push_back
#define nmax 50005
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a,b;
int ok,k,i;
vector <int>v;
int main()
{size_t found;
f>>a>>b;
found=-1;
ok=1;
while(ok)
{
found=b.find(a,found+1);
if(found!=string::npos)
{
k++;
v.pb(found);
}
else
ok=0;
}
g<<k<<"\n";
if(v.size()>1000)
k=1000;
else
k=v.size();
for(i=0;i<k;i++)
g<<v[i]<<" ";
return 0;
}