freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

最新電子辭典課程設計doc(已改無錯字)

2022-07-27 02:39:37 本頁面
  

【正文】 start_index=write_list_dat_index(head,filename,amp。word_num)。 write_listkey_dat_index(start_index)。 write_wordnum_dat_index(word_num)。 printf(%ld words has been built finished!\n,word_num)。 return 。}/*,并保存每個單詞所對的索引,生成目錄*/index_p write_content_dat_index(array_p point,char *filename){ int i。 FILE *fp。 word_p p。 trans_p t。 index_p new,head。 head=NULL。 if((fp=fopen(,ab))==NULL) { printf(Sorry,file open failed!\n)。 return NULL。 }else{ for(i=0。i26。i++){ p=pointhash[i]next。 while(p!=NULL){ new=(index_p)malloc(sizeof(index_t))。 strcpy(newword_name,pword_name)。 newposition=ftell(fp)。 newnext=NULL。 head=insert_index_node_index(head,new)。 fwrite(amp。pword_length,sizeof(pword_length),1,fp)。 fwrite(pword_name,sizeof(pword_name),1,fp)。 fwrite(amp。ptrans_num,sizeof(ptrans_num),1,fp)。 t=phead。 while(t!=NULL){ fwrite(amp。ttrans_length,sizeof(ttrans_length),1,fp)。 fwrite(ttrans_name,sizeof(ttrans_name),1,fp)。 t=tnext。 } p=pnext。 } } } fclose(fp)。 return head。}/*,并保存目錄開始的索引和目錄中單詞的個數(shù)*/long write_list_dat_index(index_p head,char *filename,long *word_num){ FILE *fp。 int t。 index_p p=head。 index_data new。 *word_num=0。 if((fp=fopen(,ab))==NULL) { printf(Sorry,file open failed!\n)。 return 0。 }else{ t=ftell(fp)。 while(p!=NULL) { strcpy(,pword_name)。 =pposition。 fwrite(amp。new,sizeof(index_data),1,fp)。 (*word_num)++。 p=pnext。 } } fclose(fp)。 return t。 }/**/void write_listkey_dat_index(long start_index){ FILE *fp。 if((fp=fopen(,ab))==NULL) { printf(Sorry,file open failed!\n)。 return 。 }else fwrite(amp。start_index,sizeof(long),1,fp)。 fclose(fp)。}/**/void write_wordnum_dat_index(long word_num){ FILE *fp。 if((fp=fopen(,ab))==NULL) { printf(Sorry,file open failed!\n)。 return 。 }else fwrite(amp。word_num,sizeof(long),1,fp)。 fclose(fp)。 return。}/**/index_p insert_index_node_index(index_p head,index_p newnode){ newnodenext=head。 head=newnode。 return head。} 模塊3代碼include include include include /**//* 模塊3: 使用二進制索引文件進行單詞查詢 *//**//**/void module3(void) { char str[30]。 long index。 index_p head=NULL。 word_p result。 trans_p t。 head=load_memory_bin(,head)。 while(1){ printf(Please input word:)。 gets(str)。 clear_space(str)。 if(strcmp(str,Exit)==0) return 。 else{ index=search_index_bin(head,str)。 if(index==1) printf(Sorry,word not found!\n)。 else{ result=search_word_with_index_bin(,index)。 t=resulthead。 while(t!=NULL){ puts(ttrans_name)。 t=tnext。 } } } }}/*,采用鏈表結構*/index_p load_memory_bin(char *filename,index_p head){ FILE *fp。 int i。 long start_index,word_num。 index_p new。 index_data new_data。 fp=fopen(filename,rb)。 if(fp==NULL){ printf(Sorry,file open failed!\n)。 return NULL。 } fseek(fp,2*sizeof(long),SEEK_END)。 fread(amp。start_index,sizeof(long),1,fp)。 fread(amp。word_num,sizeof(long),1,fp)。 fseek(fp,start_index,SEEK_SET)。 for(i=0。iword_num。i++) { new=(index_p)malloc(sizeof(index_t))。 fread(amp。new_data,sizeof(index_data),1,fp)。 strcpy(newword_name,)。 newposition=。 head=insert_index_node_index(head,new)。 } fclose(fp)。 return head。} /**/long search_index_bin(index_p head,char *str) { index_p p=head。 while(p!=NULL){ if(strcmp(pword_name,str)==0) return pposition。 p=pnext。 } return 1。}/**/word_p search_word_with_index_bin(char *filename,long position) { FILE *fp。 int i。 word_p new。 trans_p tr
點擊復制文檔內容
外語相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1