#include <cstdlib>
#include <iostream>
usingnamespace std;
int main(int argc, char *argv[])
{
string input;
int count =0, length;
cout << "Enter your text:\n";
getline(cin,input); // get a string from the user
length=(int)input.length(); // calculate length of the string
for (count =0; count < length; count ++) // loop through the entire string a character at a time
{
if(isalpha (input[count])) // if the character is alphabetical (a-z, A-Z)
{
input[count]=tolower(input[count]); // convert it to lowercase (a-z)
for(int i = 0; i<13; i++) // loop 13 times
{
if(input[count]=='z') // if the character is 'z'
input[count]='a'; // set the character to 'a'
else
input[count]++; // otherwise, increase the character by one ('a'->'b', 'c'->'d', etc)
}
}
}
cout <<"encrypted text:\n" << input << endl ; // output the altered string
system("PAUSE");
return EXIT_SUCCESS;
}