¶
~cpp #include <fstream> #include <iostream> using namespace std; void main() { ifstream fin ("source.txt"); ofstream fout ("source_enc.txt"); int x; cout << "KEY 값 : " cin >> x; int temp; char ch; do{ fin.get(ch); temp = (int) ch; fout << char(temp-x); }while(!(fin.eof())); }
¶
~cpp #include <iostream> #include <fstream> using namespace std; void main() { ifstream fin("source_enc.txt"); ofstream fout("normal.txt"); int y; cout << " KEY 값 "; cin >> y; int temp; char ch; do{ fin.get(ch); temp = (int) ch; fout << char(temp+y); }while(!(fin.eof())); }