Cod sursa(job #2331008)
| Utilizator | Data | 29 ianuarie 2019 08:45:13 | |
|---|---|---|---|
| Problema | Potrivirea sirurilor | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("strmatch.in");
ofstream g("strmatch.out");
///memoria de date
char a[2000001],*p;
int i,nr,poz,sters;
int main()
{
///memoria stiva
int potrivire[1001];
char b[2000001];
f>>a>>b;int la=strlen(a);
while(strstr(b+i,a))
{
p=strstr(b+i,a);
poz=p-b;
potrivire[++nr]=poz;
i=poz+1;
}
g<<nr<<'\n';
for(i=1;i<=1000;i++)
g<<potrivire[i]<<' ';
return 0;
}
