Cod sursa(job #240819)
Utilizator | Data | 8 ianuarie 2009 19:17:55 | |
---|---|---|---|
Problema | Potrivirea sirurilor | Scor | 14 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include<fstream.h>
#include<string.h>
char a[2000],*p,b[2000];
int n=0;
int main()
{
ifstream f("strmatch.in");
ofstream g("strmatch.out");
f>>b;
f>>a;
p=strstr(a,b);
while(p)
{ n++;
p=strstr(p+1,b);
}
g<<n;
f.close();
g.close();
return 0;
}