Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <vector>
- using namespace std;
- int main()
- {
- vector<string> st;
- string temp, temp2, temp3;
- ifstream in;
- in.open("D:\\c++\\Input.txt");
- while (!in.eof()) {
- in >> temp;
- st.push_back(temp);
- }
- for (int i = 0; i < st.size(); i++) {
- temp2 = st[i];
- for (int j = 0; j < temp2.size(); j++) {
- temp2[j] = temp2[j] + 3;
- }
- st[i] = temp2;
- }
- cout << "Encrypted message: ";
- for (int i = 0; i < st.size(); i++) {
- cout << st[i] << " ";
- }
- cout << "\nDecrypted message: ";
- for (int i = 0; i < st.size(); i++) {
- temp2 = st[i];
- for (int j = 0; j < temp2.size(); j++) {
- temp2[j] = temp2[j] - 3;
- }
- st[i] = temp2;
- }
- for (int i = 0; i < st.size(); i++) {
- cout << st[i] << " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement