Cod sursa(job #1541556)
Utilizator | Data | 4 decembrie 2015 11:29:28 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 38 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include <fstream>
#include <string>
using namespace std;
ifstream in("strmatch.in");
ofstream out("strmatch.out");
string s, p;
int found,v[100001],k=0;
int main()
{
in>>p>>s;
while(found<=s.size())
{
found=s.find(p,found+1);
v[k++]=found;
}
out<<k-1<<'\n';
for(int i=0;i<k-1;i++)
out<<v[i]<<' ';
return 0;
}