Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- #include <stdio.h>
- using namespace std;
- int main()
- {
- string str;
- vector <char> text;
- ifstream is;
- cin >> str;
- is.open(str);
- int n = 0;
- for (int i = 0; !is.eof(); i++)
- {
- char s;
- s = is.get();
- text.push_back(s);
- n++;
- }
- is.close();
- for (int j = 0; j < n; j++)
- {
- if ((text[j] < 'n' && text[j] >= 'a')|| (text[j] < 'N' && text[j] >= 'A'))
- {
- text[j] += 13;
- }
- else if ((text[j] >= 'n' && text[j] <= 'z') || (text[j] >= 'N' && text[j] <= 'Z'))
- {
- text[j] -= 13;
- }
- else
- {
- continue;
- }
- }
- for (int j = 0; j < n-1; j++)
- {
- if (text[j] == '\n')
- {
- cout << endl;
- }
- else
- {
- cout << text[j];
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment