/* Author: Shawn Biddle Description: This fairly useless program converts up to 256 characters to and from ROT13. Date Created: 2/8/2007 21:00 */ #include //standard I/O header #include //for tolower #include //for SetConsoleTitle #include //for getch() instead of waiting for linefeed using namespace std; int main(){ char userInput[256]; char exit; short i; do { system("cls"); //Clears the screen SetConsoleTitle("ROT13 Translator"); //Alternate Method would be using "system("title ");" cout<<"Enter a sentance (up to 256 letters including spaces): "; cin.getline(userInput, 256, '\n'); //Gets user input and ends input after encountering a new line system("cls"); cout<<"This is the original input:\n"<< userInput << endl; //This for loop is the actual "encryption"; A->M Converted to N->Z for (i=0;i < sizeof(userInput);i++){ userInput[i]=toupper(userInput[i]); if(int(userInput[i])>=65 && int(userInput[i])<=77){ userInput[i] += 13; } else if(int(userInput[i])>=78 && int(userInput[i])<=90){ userInput[i] -= 13; } } //Convert back to lowercase for (i=0;i < sizeof(userInput);i++){ userInput[i]=tolower(userInput[i]); } cout <<"\nThis is the phrase translated:\n"<