Pagini recente » Cod sursa (job #511135) | Borderou de evaluare (job #1075402) | Borderou de evaluare (job #1300037) | Borderou de evaluare (job #853904) | Cod sursa (job #1970954)
#include <bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("strmatch.in");
ofstream g("strmatch.out");
string a;
string b;
f>>a>>b;
cout<<a.size()<<" "<<a[a.size()];
int rep=0, gasit;
for(int i=0; i<b.size(); ++i)
{
if(b[i]==a[0])
{
gasit=1;
for(int j=1; j<a.size(); ++j)
{
if(b[i+j]!=a[j])
{
gasit=0;
break;
}
}
if(gasit==1)
rep++;
}
}
g<<rep;
return 0;
}