Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream >
- using std :: cout;
- using std :: endl;
- void encrypt( char [ ] ); // prototypes of functions used in the code
- void decrypt( char * ePtr );
- int main( )
- {
- string temp;
- // create a string to encrypt
- char string[ ] = "sugi pula teacher";
- cout << "Original string is: " << string << endl;
- encrypt( string );
- // call to the function encrypt( )
- cout << "Hey teacher.. " << string << endl;
- cout << "you want to know what it means? (Y/N)" << endl;
- cin >> temp;
- if (temp == "Y" || temp == "y"){
- decrypt( string );
- cout << "it means.. " << string << " :D " << endl;
- }
- else if (temp == "N" || temp == "n")
- cout << "ok fuck you" << endl;
- return 0;
- }// main
- //encrypt data
- void encrypt (char e[] )
- {
- for( int i=0; e[i] != '\0'; ++i ) ++e[i];
- } // encrypt
- //decrypt data
- void decrypt( char * ePtr ) {
- for( ; * ePtr != '\0'; ==* ePtr ) --(* ePtr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement