Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 KB | None | 0 0
  1.  
  2. // Example program
  3. #include <iostream>
  4. #include <string>
  5. using namespace std;
  6.  
  7.  
  8.  
  9. int main()
  10. {
  11. bool enc = 0; //change this to encript or decript
  12. string user;
  13.  
  14. //cout<< msg[0];
  15.  
  16. int a;
  17.  
  18. char b;
  19.  
  20. getline(cin, user);
  21.  
  22. if (enc){
  23. for(int i=0; i<user.length(); i++)
  24. {
  25.     // cout<<msg[i];  
  26.     a = user[i];
  27.     a=(a +1);
  28.     //cout << a;
  29.     b = a;
  30.     cout << b;// << " ";
  31. }
  32. cout << "\n ";
  33. }else{
  34.  
  35. for(int i=0; i<user.length(); i++)
  36. {
  37.   // cout<<msg[i];  
  38.     a = user[i];
  39.     a=(a -1);
  40.     //cout << a;
  41.     b = a;
  42.     cout << b;// << " ";
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement