#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
char str[100];
cout<<"请输入你想要生成的凯撒密码:"<<endl;
cin>>str;
cout<< "你输入的是:"<<str<<endl;
int i=0;
while(str[i]!=0)
{
if(str[i]>='a'&&str[i]<='w')
str[i]=str[i]+'A'-'a'+3; // +'A'-'a'+3 =29
else if(str[i]>='A'&&str[i]<='W')
str[i]+=3;
else if(str[i]>='x'&&str[i]<='z')
str[i]=str[i]-'x'+'A';
else if(str[i]>='X'&&str[i]<='Z')
str[i]=str[i]-'x'+'A';
i++;
}
cout<<"加密后是内容是:"<<str<<endl;
system("pause");
return 0;
}