#include <windows.h> #include <iostream> #include <string> using namespace std; string encrypt (string cde); int main() { char A, B, C, letter, vault; string temp, ENC; start: cout << "Choose task: " << endl; cout << endl; cout << "A. Encrypt" << endl; cout << "B. Decrypt" << endl; cout << "C. Exit Program"<< endl; cout << endl; cin >> letter; system ("CLS"); if (letter == 'A' ) { string cde, ENC; int shift; cout << "Please enter a message: "; getline(cin, cde); string temp = cde; int length; length = (int)temp.length(); for (int i = 0; i < length; i++) { if (isalpha(temp[i])) { for (int j = 0; j < 6; j++) { if (temp[i] == 'z') { temp[i] = 'a'; } else if (temp[i] == 'Z') { temp[i] = 'A'; } else { temp[i]++; } } } } cout << "\nEncoded message: " << temp << endl; } else if (letter =='B' ) { s2: cout << "B" << endl; } else if (letter == 'C') { s3: return 0; } else { cout << "Invalid Input."; Sleep(500); system ("CLS"); goto start; } return 0; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)