⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testlzw.cpp

📁 用C++语言编译的LZW压缩算法
💻 CPP
字号:
//:testLZW.cpp
#include <iostream>
#include <string>
#include "LZW.h"
using namespace std;

int main()
{
	try{
		LZW L;
		string s;
		cout << "Please input the file name you want compact: " << endl;
		cin >> s;
		L.compact(s.c_str());
		cout << "Compact success and the compact file is: " << s << ".zzz" << endl;
		cout << "Please input the file name(suffix is .zzz) you want decompress: " << endl;
		cin >> s;
		L.deCompact(s.c_str());
		s.erase(s.length()-4);
		cout << "Decompress success and the decompressed file is: " << "LZW" << s << endl;
	} catch(LZWException& e){
		cout << e.what() << endl;
		cout << "Program abort." << endl;
	}

	return 0;
}//end main

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -