~cpp #include <fstream> #include <iostream> using namespace std; int main() { ifstream fin("source.txt"); ofstream fout("output.txt"); // ofstream fout2("result.txt"); char a; int key; cout << "key (,) : "; cin >> key; while(fin>>a) { fout << (char)((int)a+key); cout << (char)((int)a+key); } cout << " ....\n"; return 0; }
.......
.... ..
.... ..