개인키:100, 공개키:156
공개키 ¶
~cpp #include <fstream> #include <iostream> #include <stdlib.h> using namespace std; int main() { ifstream fin("input.txt"); ofstream fout("output.txt"); int f = 156; char a[20]; for (int i = 0; ; i++) { fin.getline(a,20); if (!strcmp(a, "") && fin.eof()) break; int c = strlen(a); for (int d=0;d<c;d++) { cout << (char)(a[d]+f); fout << (char)(a[d]+f); } cout << endl; fout << endl; } return 0; }
개인키 ¶
~cpp #include <fstream> #include <iostream> #include <stdlib.h> using namespace std; int main() { ifstream fin("output.txt"); ofstream fout("output2.txt"); int f = 100; char a[20]; for (int i = 0; ; i++) { fin.getline(a,20); if (!strcmp(a, "") && fin.eof()) break; int c = strlen(a); for (int d=0;d<c;d++) { cout << (char)(a[d]+f); fout << (char)(a[d]+f); } cout << endl; fout << endl; } return 0; }