Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- printf("Hello world!\n");
- FILE *f;
- f=fopen("date.in","r");
- int x=0,p,i;
- char txt[20],buf[20];
- char txt1[20][5];
- fscanf(f,"%s",txt);
- //puts(txt);
- while ( fscanf(f,"%s",buf)==1 )
- {
- int ok=0;
- for (i=0; i<x;i++)
- if (strstr(txt1[i][5],buf))
- ok=1;
- if (ok==0)
- {
- strcpy(txt1[x][5],buf);
- if (strstr(txt,buf)!=NULL)
- p++;
- }
- x++;
- }
- printf("%d",p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement