Pagini recente » Borderou de evaluare (job #2558927) | Cod sursa (job #1789841) | Diferente pentru problema/ciob intre reviziile 5 si 22 | Borderou de evaluare (job #3169137) | Cod sursa (job #2265238)
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
int main()
{
int nr=0, v[100], k=0;
int pos=0;
string a, b;
f>>a>>b;
while ((pos = b.find(a, pos)) != string::npos)
{
nr++;
v[k]=pos;
k++;
pos++;
}
g<<nr<<endl;
for(int i=0;i<k;i++)
g<<v[i]<<" ";
return 0;
}