Cod sursa(job #99358)
Utilizator | Data | 11 noiembrie 2007 10:39:15 | |
---|---|---|---|
Problema | Abc2 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Happy Coding 2007 | Marime | 0.37 kb |
#include<string.h>
#include<stdio.h>
FILE *f=fopen("abc2.in","r"),*g=fopen("abc2.out","w");
char a[10000015],x[29],b[50005][29];
long k;
void go()
{
fgets(a,10000010,f);
do
{
fgets(x,25,f);
long q=strlen(x)-1;
if(x[q]=='\n') x[q]=0;
if(strstr(a,x)) k++;
}while(!feof(f));
}
int main()
{
go();
fprintf(g,"%D",k-1);
return 0;
}