诸位大侠,麻烦帮忙改一个C++程序

来源:百度知道 编辑:UC知道 时间:2024/05/21 20:51:08
#include<iostream>
using namespace std;
#define MINCHAR 32
#define CHARSUM 94
char table[CHARSUM][CHARSUM];
bool Init();
bool Encode(char* key, char* source, char* dest);
bool Dncode(char* key, char* source, char* dest);
int main()
{
if(!Init())
{
cout << "初始化错误!" << endl;
return 1;
}
char key[256];
char str1[256];
char str2[256];
int operation;
while(1)
{
do
{
cout << "请选择一个操作:1. 加密; 2. 解密; -1. 退出\n";
cin >> operation;
}while(operation != -1 && operation != 1 && operation != 2);
if(operation == -1)
return 0;
else if(operation == 1)//加密
{
cout << "请输入密钥:";
cin >> key;
cout << "请输入待加密字符串:";
cin >> str1;
Encode(key, str1, str2);
cout << "加密后的字符串:" << str2

是要加密如:txt,doc,ini等之类的数据文件,而不是上面程序里的字符,对吗?

改什么改呀,一点问题都没有

加密,解密都试过了,没出错,结果也正确

麻烦您大虾先学点基础知识行不?