1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
#include <fstream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
ifstream ifs;
ifs.open("klar.txt");
ofstream ofs;
ofs.open("geheim.txt");
char c;
char rot13 [] = {'N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'A','B','C','D','E','F','G','H','I','J','K','L','M',
};
while( ( c = ifs.get() )!= EOF )
{
ofs<<rot13[c - 'A'];
}
ifs.close();
ofs.close();
return 0;
}
|