加密算法 题解:
#include<bits/stdc++.h>
using namespace std;
int main(){
string str;
while(cin >> str){
for(char c:str){
if(c >= 'a' && c <= 'z') {
c='a'+(c-'a'+3)%26;
cout << c;
}else if(c >= 'A' && c <= 'Z') {
c='A'+(c-'A'+3)%26;
cout << c;
}else
cout << c;
}
cout << " ";
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发