Pagini recente » Cod sursa (job #420510) | Diferente pentru training-path intre reviziile 132 si 16 | Cod sursa (job #3305545) | Cod sursa (job #3357337) | Cod sursa (job #3357768)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("strmatch.in");
ofstream fout("strmatch.out");
string A, B;
vector <int> V;
int main()
{
fin>>A>>B;
int poz=0;
while(B.find(A, poz) < B.size() && V.size() < 999)
{
//cout<<poz<<endl;
int poz_found = B.find(A, poz);
V.push_back(poz_found);
poz = poz_found + 1;
}
int lungV = V.size();
fout << min(1000, lungV) << endl;
for(int i = 0; i < min(1000, lungV); i++)
fout << V[i] << " ";
return 0;
}