📄 main.cpp
字号:
#include "defines.h"
void main()
{
vector<string> codeResult;
vector<hNode> huffmanTree;
string iFileName("input.txt");
cout << "please input your file: " << endl;
// cin >> iFileName;
/* string oFileName("input.txt");
ofstream outFile(oFileName.c_str());
for(int ix = 0; ix < 26; ix++)
{
for(int iy = 0; iy <= ix; iy++)
{
outFile.put( 'a' + ix);
}
}
outFile.close();*/
ifstream inFile(iFileName.c_str());
if(!inFile)
{
cout << "unable open " << iFileName << endl;
cout << "please check the file name!" << endl;
}
GatherData(inFile, huffmanTree);
CheckData(huffmanTree,"src.txt");
CreatHuffmanTree(huffmanTree);
CheckData(huffmanTree,"rate.txt");
HuffmanCoding(huffmanTree, codeResult);
// CheckData(codeResult,"code.txt");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -