Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- string
- encrypt (string text)
- {
- char code[2][27] = {{"abcdefghijklmnopqrstuvwxyz"},{"SJFOXIC93028475&^#@!)(_+Y<"}};
- for (int i = 0; i < text.size (); i++)
- for (int j = 0; j < 26; j++)
- if (text[i] == code[0][j])
- {
- cout << code[1][j];
- }
- cout << endl;
- }
- int
- main ()
- {
- string text;
- cout << "Enter your text: ";
- cin >> text;
- cout << endl;
- encrypt(text);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement