Job Recruitment Website - Ranking of immigration countries - 高分 求C++源代码!维吉利亚加密
高分 求C++源代码!维吉利亚加密
完全按照你的要求
void encrypt (/*输入*/字符串密钥,/*输入和输出*/string & amp;msg){
string OrgMsg;
OrgMsg = msg
int j = ;
for(int I = ;我& ltmsg . length();i++)
{
if(j & gt;= key . length())
{
j = ;}
msg[I]=(code(orgmsg . at(I))+code(key . at(j)))% 26+' A ';
j++;}
返回;}
这样就可以了
在调用的时候请注意,不能这样的
密文= encrypt(key,msg);cout & lt& lt”密文是:“& lt& lt密文& lt& ltendl
只能是
加密(密钥,消息);cout & lt& lt”密文是:“& lt& ltmsg & lt& ltendl
因为你给出的加密函数是没有返回值的p
谢谢
- Previous article:How to apply for a tourist visa to Dubai?
- Next article:Which nation was the first to immigrate to the United States?
- Related articles
- Why do people in Shanghai prefer to be scolded by Suzhou people rather than Ningbo people?
- How long will Suzhou residence permit expire?
- The audience didn't get enough of the finale of Ningmin Town. Do you think the play is good?
- Beijing immigration project
- How about a Palau tourist visa?
- What proof do you need to immigrate to Europe?
- I'm short of games recently, and I don't know what games to play. ....
- Real questions for the CET-3 English test in March (Reading Comprehension B)
- Henan promised to publicize the jurisdiction of the Ministry of Communications.
- Where can I get a passport?