- #include<string>
- #include<iostream>
- using namespace std;
- void change(char messgee[]);//函数声明,对输入的密码进行转换。
- const char*plain ="VWXYZABCDEFGHIGKLMNOPQRSTU";//其对应的密码是ABCDEFG......;
- void main()
- {
- char message[201];
- cout<<"Please input the information:";
- gets(message);//注意同cin输入的区别。
- change(message);
- cout<<message;
- }
- void change(char message[])
- {
- int i,k=strlen(message);
- for(i=0;i<k;i++)
- if(message[i]>='A'&&message[i]<='Z')
- message[i]=plain[message[i]-'A'];
- return;
- }
- //该片段来自于http://www.codesnippet.cn/detail/2608201410346.html
来源: http://www.codesnippet.cn/detail/2608201410346.html