Cod sursa(job #98971)
Utilizator | Data | 10 noiembrie 2007 19:48:47 | |
---|---|---|---|
Problema | Abc2 | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Happy Coding 2007 | Marime | 0.44 kb |
#include<stdio.h>
#include<string.h>
#define max 10000001
// strstr
FILE *f=fopen("abc2.in","r");
FILE *g=fopen("abc2.out","w");
char x[max],y[22],*p;
long c=0;
int main()
{
fgets(x,max,f);
while(!feof(f))
{
char aux[20]="";
fgets(y,20,f);
strncpy(aux,y,strlen(y)-1);
p=strstr(x,aux);
if(p==NULL)
c=c;
else c++;
}
fprintf(g,"%ld",c);
fcloseall();
return 0;
}