Cod sursa(job #812291)
| Utilizator | Data | 13 noiembrie 2012 18:56:09 | |
|---|---|---|---|
| Problema | Potrivirea sirurilor | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.36 kb |
#include<stdio.h>
#include<string.h>
int strmatch(const char *s,char *s1)
{
char *p;int nr=0;
p=strstr(s,s1);
while(p)
{
nr++;
p=strstr(p+1,s1);
}
return nr;
}
int main()
{
freopen("strmatch.in","r",stdin);
freopen("strmatch.out","w",stdout);
char a[2000005],b[2000005];
gets(a);
gets(b);
printf("%d\n",strmatch(a,b));
return 0;
}
