📄 haffman.cpp
字号:
#include<fstream.h>
#include<iostream.h>
#include<string.h>
#include<stdlib.h>
#define Max 300
const MaxValue=1000;
#include"HaffMan.h"
void main()
{
int a;
char str[30];
Haffman haffman;//-------不带参数的构造函数不可用缺省的方式
cout<<"对file文件进行编码,编码后文件存入codefile中"<<endl;
haffman.HaffManC();
cout<<"对文件codefile进行译码,译码结果存入textfile中"<<endl;
haffman.HaffCodeD();
//cout<<"grand="<<a<<endl;
cout<<"打印哈夫曼树与否?"<<endl;
cin>>str;
if(strcmp(str,"Yes")==0)
{
a=haffman.Get();
haffman.HaffCodeT(a,0);
}
cout<<"打印文本file中不同字符对应的编码与否?"<<endl;
cin>>str;
if(strcmp(str,"Yes")==0)
haffman.HaffCodeP();
//return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -