?? decryptcoding.cpp
字號(hào):
#include"Huffmanhead.h"
extern char ShuruName[MAX];
void DecryptCoding(char ShuruName[],HuffmanTree HT[],int n)//對(duì)輸入的二進(jìn)制進(jìn)行譯碼
{
int i,j,m;
char Code;
m=2*n-1;
if(m==1)
i=2;
else
i=m;
printf("Please enter the code which you want to convert:\n\n");
printf("Code=");
scanf("%c",&Code);
printf("\n");
printf("Decryptcode are:\n\nDecryptCode=");
while(Code!=10)//Code等于回車(chē)符時(shí)停止
{
if(Code=='0')
i=HT[i].lchild;
else
i=HT[i].rchild;
if(HT[i].lchild==0)
{
printf("%c",ShuruName[i]);
j=i;
if(m==1)
i=2;
else
i=m;
}
scanf("%c",&Code);
}
if(HT[j].lchild!=0)
printf("You have input the wrong code,can't to convert!");
printf("\n\n");
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -