Cod sursa(job #2119847)
Utilizator | Data | 1 februarie 2018 18:09:54 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.33 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a,b;
int p,sol[1001],k;
int main()
{
f >> a >> b;
while(p=b.find(a,p)+1)
sol[++k]=p-1;
g << k << "\n";
// p=0;
while(p<k && p<1001)
g << sol[++p] << " ";
return 0;
}