调式过 正确
#include <iostream>
#include <cstring>
using namespace std;
class cchange{
private:
char *text;
public:
cchange()
{text=0;}
void input(char *s)
{text=s;
}
void change()
{
char *temp=text,*cc;
cc=temp;
while (*temp)
{
if (*temp+3>'z' && *temp+3>'a')
*temp='a'+(*temp+2-'z');
else if (*temp+3>'Z' && *temp+3>'A' && *temp+3<='Z'+3)
*temp='A'+(*temp+2-'Z');
else
*temp=*temp+3;
temp++;
}
}
void display()
{ cout<<"加密后的字符串是:"<<text<<endl;
}
};
int main()
{
cchange myclass;
char *vv=new char[100];
cout<<"请输入要加密的字符串:";
cin>>vv;
myclass.input(vv);
myclass.change();
myclass.display();
return 0;
}