//读入文件进行译码 函数如下 
//请懂的高手给我改下 谢谢
//我的思路是读赫夫曼树到叶子节点将一组字符串存入字符串数组,找到编码HC中对应的字母 //输//出
void Decoding(HuffmanTree HT,HuffmanCode HC,char ww[],int num,int n)           //译码函数(从文件b中读入译码)
{   FILE *fp;
    char t[5*n];
    int ii=0;
    fp=fopen("b.txt","r+");
    while(!feof(fp))
   { t[ii]=fgetc(fp);
    ii++;
   }
   fclose(fp);
    
    int count,j=0;    
    char aa[n][5];
    
    int i=0;
    printf("译码结果为:");
    while(t[i]!=EOF)                                  //当t[i]不等于EOF即-1时
    { 
        int p=2*num-1;
        count=0;
    while(HT[p].lchild!=NULL&&HT[p].rchild!=NULL)
        {  
            if(t[i]=='0')
            {
            aa[j][count]='0';
            p=HT[p].lchild;
            }
            else if(t[i]=='1')
            {
            aa[j][count]='1';
            p=HT[p].rchild;
            }
            count++;
                i++;
            
        }
        
        for(int q=1;q<=num;q++)
         if (!strcmp(aa[j],HC[q]))
         printf("%c\n",ww[q]);
        j++;
                            
    }
    
    
}