Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3.                               Online C++ Compiler.
  4.                Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13.  
  14. string
  15. encrypt (string text)
  16. {
  17.   char code[2][27] = {{"abcdefghijklmnopqrstuvwxyz"},{"SJFOXIC93028475&^#@!)(_+Y<"}};
  18.   for (int i = 0; i < text.size (); i++)
  19.     for (int j = 0; j < 26; j++)
  20.       if (text[i] == code[0][j])
  21.     {
  22.       cout << code[1][j];
  23.     }
  24.   cout << endl;
  25. }
  26.  
  27.  
  28. int
  29. main ()
  30. {
  31.   string text;
  32.  
  33.   cout << "Enter your text: ";
  34.   cin >> text;
  35.   cout << endl;
  36.   encrypt(text);
  37.   return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement