Pagini recente » Cod sursa (job #1183058) | Istoria paginii runda/simulare-cartita-37 | Istoria paginii runda/agm2018runda1 | Cod sursa (job #804219) | Cod sursa (job #2935223)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("strmatch.in");
ofstream fout ("strmatch.out");
int main()
{
string word;
string text;
fin>>word>>text;
int poz=0;
for (int i=0; i<text.size(); i++)
{
bool match=true;
for (int j=0; j<word.size(); j++)
{
if (text[poz+j]!=word[j])
{
match=false;
break;
}
}
if (match==true)
{
fout<<poz<<" ";
}
poz++;
}
return 0;
}