No older revisions available
No older revisions available
~cpp
#include<iostream>
#include<fstream>
using namespace std;
void main()
{
char fileName[10];
cout << "암호화 입력 파일이름: ";
cin >> fileName;
ifstream fin(fileName);
ofstream fout("output.txt");
char temp;
while(fin.get(temp))
{
temp += 3; //비밀키 +3
fout << temp;
cout << temp;
}
fin.close();
fout.close();
cout << "\n복호화 출력 파일이름: ";
cin >> fileName;
ifstream fin1("output.txt");
ofstream fout1(fileName);
while(fin1.get(temp))
{
temp -= 3; //비밀키 -3
fout1 << temp;
cout << temp;
}
fin1.close();
fout1.close();
}