Pagini recente » Monitorul de evaluare | Borderou de evaluare (job #2174398) | Borderou de evaluare (job #2592273) | Borderou de evaluare (job #609746) | Cod sursa (job #2265246)
#include <bits/stdc++.h>
#define NMax 200005
using namespace std;
ifstream f("algoritm.in");
ofstream g("algoritm.out");
int main()
{
int nr=0, v[NMax], 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;
}