#define _WIN32_WINNT 0x0403 #define _AFXDLL 111 #include #include #include #include #include #include "heap.h" #include "Proteinheap.h" using namespace std; using namespace boost; int nametrim(char* str) { for(int i=0;str[i]!='\0';i++) { if(str[i]=='\n') { str[i]='\0'; return 1; } } return 1; } int getnumber(const char* str) { int number=0; int digit=-1; int k=1; for(int i=0;str[i]!='\0';i++) { digit++; if(str[i]==',')digit--; } for(int i=0;str[i]!='\0';i++) { if(str[i]==',')continue; k=1; for(int j=0;jcount=atoi(data+5*sizeof(char)); } if(data[0]=='n'&&data[1]=='a')//储存提交蛋白名称 { strcpy(newnode->ProteinName,data+5*sizeof(char)); } if(data[0]=='s'&&data[1]=='o')//储存来源生物 { strcpy(newnode->Source,data+7*sizeof(char)); return 1; } fgets(data,300,pfile);//获得一行data } return 1; } int ProteinfiltbyGS(Protein_PRIORITY_QUEUE proteinque,FILE* pfile) { ProteinNode newpronode; string procontent="\0"; while(!feof(pfile)) { ReadProteinInfo(&procontent,pfile,&newpronode); if(newpronode.count==0)continue; /* nametrim(newpronode.ProteinName); char newurl[300]="http://scholar.google.com/scholar?q=\""; strcat(newurl,newpronode.ProteinName); strcat(newurl,"\"+ecoli&hl=en"); cout<QueryInfoStatusCode(dwStatusCode); cout<<"Net work status code:"<ReadString(data)) //将网页内容读入content { content += linefeed; content += data; } content.TrimRight(); //忽略每行右边的空格 cout<<"Web page download succeed"<.*?About (.*?) results");//检索数的正则表达式,可修改 smatch matches; regex_search(start, end, matches, expression); string resultnumber(matches[1].str().c_str()); cout<Close(); delete phttpfile; session.Close();*/ newpronode.count=0; } return 1; } int main() { Protein_PRIORITY_QUEUE ProteinQueue=Procreate_pq(200); //储存符合要求的蛋白 FILE* filelink=fopen("finallist_revised_selected.txt","r"); ProteinfiltbyGS(ProteinQueue,filelink); fclose(filelink); FILE* pwinnerfile=fopen("winner.txt","w"); ProshowHeap(ProteinQueue); while(!Prois_Empty(ProteinQueue)) { ProteinNode element=ProdeQueueMax(ProteinQueue); fprintf(pwinnerfile,"\nrate:%d\nname:%s\nsource:%s\n",element.count,element.ProteinName,element.Source); } fclose(pwinnerfile); while(1); return 0; }