Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include <iostream >
  2. using std :: cout;
  3. using std :: endl;
  4. void encrypt( char [ ] ); // prototypes of functions used in the code
  5. void decrypt( char * ePtr );
  6. int main( )
  7. {
  8. string temp;
  9. // create a string to encrypt
  10. char string[ ] = "sugi pula teacher";
  11. cout << "Original string is: " << string << endl;
  12. encrypt( string );
  13. // call to the function encrypt( )
  14. cout << "Hey teacher.. " << string << endl;
  15. cout << "you want to know what it means? (Y/N)" << endl;
  16. cin >> temp;
  17. if (temp == "Y" || temp == "y"){
  18.     decrypt( string );
  19. cout << "it means.. " << string << " :D " << endl;
  20. }
  21. else if (temp == "N" || temp == "n")
  22.     cout << "ok fuck you" << endl;
  23. return 0;
  24. }// main
  25.  
  26. //encrypt data
  27. void encrypt (char e[] )
  28. {
  29. for( int i=0; e[i] != '\0'; ++i ) ++e[i];
  30. } // encrypt
  31.  
  32. //decrypt data
  33. void decrypt( char * ePtr ) {
  34. for( ; * ePtr != '\0'; ==* ePtr ) --(* ePtr);
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement