Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fstream>
- #include <iostream>
- using namespace std;
- int main()
- {
- ifstream fin;
- string name;
- cin >> name;
- char c;
- fin.open(name);
- while ((c = fin.get()) != EOF) {
- if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
- {
- if (c + 13 > 'z')
- {
- c = c + 12 - 'z' + 'a';
- }
- else {
- if (c + 13 > 'Z' && c < 'a')
- {
- c = c + 12 - 'Z' + 'A';
- }
- else {
- c = c + 13;
- }
- }
- }
- cout << c;
- }
- fin.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement