Skip to content

Instantly share code, notes, and snippets.

@duyet
Created March 10, 2015 14:09
Show Gist options
  • Save duyet/39efb003f6aef25fba8d to your computer and use it in GitHub Desktop.
Save duyet/39efb003f6aef25fba8d to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <conio.h>
#include <string>
#define MAX 1000
int main()
{
FILE* f;
char str[300];
int anh[300];
char *str1,*str2;
int i=0;
string english[MAX];
f = fopen("va.dd","rt");
int c = 0;
while (fgets(str,300,f)>0 && c < 1000)
{
str1 = strstr(str,"##");
if (str1!=NULL)
{
str2 = strstr(str1,"|-");
if (str2!=NULL && strlen(str2+2)<15) english[c] = (str2+2);
}
//getch();
}
fclose(f);
for (int i = 0; i < c; i++) {
puts(english[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment