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

正文內(nèi)容

基于哈夫曼編碼的數(shù)據(jù)壓縮解壓程序論文-資料下載頁(yè)

2025-06-27 20:46本頁(yè)面
  

【正文】 elen=0。ofstream outfile(outfilename,ios::binary|ios::out)。 //打開編碼后文件if(!outfile) { cerr輸出文件打開失敗endl。 return。}char buf[513]=\0。 //讀入編碼緩沖區(qū)char buf1[257]=\0。(8)。 /* 讀取編碼,解壓連入緩沖區(qū) */while(1) { while(readlen(clength8)amp。amp。strlen(buf)=256) //讀滿緩沖區(qū) { ((char *)amp。temp,sizeof(temp))。 ctoa(temp,code)。 //將字節(jié)轉(zhuǎn)為數(shù)組 strcat(buf,code)。 readlen++。 }//while while(strlen(buf)=256) //處理緩沖區(qū),直到少于256位,再讀滿它 { for(i=0。istrlen(buf)。i++) { strcpy1(buf1,buf,i+1)。 //逐漸增多取,放入buf1,進(jìn)行匹配 if(strcmp1(buf1,header,n,temp)==1) { ((char *)amp。temp,sizeof(unsigned char))。 writelen++。 strcpy(buf,buf+i+1)。 //緩沖區(qū)前移 break。 } }//for if(writelen=flength) break。 //如果寫入達(dá)到原文件長(zhǎng)度,退出 }//while if(readlen=(clength8)/*編碼長(zhǎng)度*/||writelen=flength) break。 //如果寫入或者讀入編碼完畢,退出}//退出此循環(huán)后,還有未解碼完成的buf[]//對(duì)buf[]緩沖的善后處理while(writelenflength){ for(i=0。istrlen(buf)。i++) { strcpy1(buf1,buf,i+1)。 if(strcmp1(buf1,header,n,temp)==1) { ((char *)amp。temp,sizeof(unsigned char))。 writelen++。 strcpy(buf,buf+i+1)。 break。 } }//for}()。 //關(guān)閉文件()。}//unpress()void MainMeun(){ cout******************哈夫曼編碼/譯碼器********************endl。 coutendl。 cout*********************uit*************************endl。 cout*********************HHelp*************************endl。 cout*********************CCoding***********************endl。 cout*********************DDecoding*********************endl。 cout*********************LList Text Document***********endl。 }void show() { string contents。 char filename[200]。 //coutsfd。 cout該文件的內(nèi)容為:endl。 cinfilename。 ifstream in(filename,ios::out)。 while(!()) incontents。 coutcontents。 }void help(){coutendl。cout ★★★★★★★★★哈夫曼編碼/譯碼器★★★★★★★★★ endl。coutendl。cout使用說(shuō)明:endl。coutendl。cout壓縮文件:endl。coutendl。cout 在源文件中輸入您所要壓縮的文件!輸入地格式為:路徑\\壓縮前文件名endl。cout 在目標(biāo)文件中輸入您壓縮后將文件保存的地址!輸入地格式為:路徑\\壓縮后文件名endl。cout 例如:[源文件]:d\\endl。cout [目標(biāo)文件]:d:\\endl。coutendl。cout解壓文件:endl。cout 在源文件中輸入您所要解壓的文件!輸入地格式為:路徑\\壓縮前文件名endl。cout 在目標(biāo)文件中輸入您解壓后將文件保存的地址!輸入地格式為:路徑\\壓縮后文件名endl。cout 例如:[源文件]:d:\\endl。cout [目標(biāo)文件]:d:\\endl。coutendl。}int main(int num,char *cmdline[]){ char infilename[256],outfilename[256],select[255]。 char choice。 if(num3) { strcpy(select,cmdline[1])。 strcpy(infilename,cmdline[2])。 strcpy(outfilename,cmdline[3])。}else if(num==1){ MainMeun()。 cout請(qǐng)輸入您的選項(xiàng)(Q/H/C/D):。 cinchoice。 }switch(choice){ case 39。C39。: cout[源文件]:。 cininfilename。 cout[目標(biāo)文件]:。 cinoutfilename。 press(infilename,outfilename)。break。 case 39。D39。: cout[源文件]:。 cininfilename。 cout[目標(biāo)文件]:。 cinoutfilename。 unpress(infilename,outfilename)。break。 case 39。H39。: help()。break。 case 39。Q39。:exit(0)。break。 case 39。L39。: show()。break。} return 0。 } 24
點(diǎn)擊復(fù)制文檔內(nèi)容
電大資料相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1