Created
November 26, 2011 17:58
-
-
Save fullmated/1396046 to your computer and use it in GitHub Desktop.
0017: Caesar Cipher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#define F )!=string::npos | |
#define N s.find( | |
using namespace std; | |
main(){ | |
string s; | |
while(getline(cin,s)){ | |
for(int i,j=26;j--;){ | |
if(N"the"F||N"this"F||N"that"F){ | |
cout<<s<<endl;break; | |
} | |
for(i=s.size();i--;) | |
s[i]=s[i]-'z'?96<s[i]?s[i]+1:s[i]:97; | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment