Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Made for Jonas and Callum by their favourite
- Compiled using g++ under Debian GNU/Linux
- */
- #include<iostream>
- #include<vector>
- #include<string.h>
- #include<stdio.h>
- #define PUSH 3
- using namespace std;
- int main()
- {
- string Input = "string Input";
- cout << "Please enter your sentence: \n>";
- getline(cin,Input);
- char Buffer[1024];
- char Output[1024];
- strcpy(Buffer,Input.c_str());
- for (int i = 0; i < Input.length(); i++)
- {
- Buffer[i] = tolower(Buffer[i]); //you're getting lowercase
- if (Buffer[i] < 61) Output[i] = Buffer[i];
- else if (Buffer[i] > 122 - PUSH) Output[i] = Buffer[i] + PUSH - 26;
- else Output[i] = Buffer[i] += PUSH;
- }
- cout << "\nYour 'encrypted' string is: ";
- for(int i = 0; i <= Input.length(); i++) cout << Output[i];
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment