Cod sursa(job #99355)
Utilizator | Data | 11 noiembrie 2007 10:36: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[10000001],x[21],b[50001][21];
long k;
void go()
{
fgets(a,10000001,f);
do
{
fgets(x,30,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;
}