Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "string.h"
- typedef struct{
- char linhas[100];
- }LINHAS;
- void main(){
- int i=0,n;
- char palavra[100];
- scanf("%s", palavra );
- LINHAS st[100];
- char fa[100];
- FILE * f = fopen("tatas.txt", "r");
- while(fscanf(f, "%[^\n]\n", fa)!=EOF){
- strcpy(st[i].linhas, fa);
- i++;
- n=i;
- }
- for(int i =0; i<=100;i++){
- if(strstr(st[i].linhas,palavra)!=NULL){
- printf(st[i].linhas);
- }
- }
- fclose(f);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement