文章

66

粉丝

0

获赞

40

访问

2.3k

头像
加密算法 题解:
P1014 华南师范大学/贵州大学机试题
发布于2026年1月28日 15:16
阅读数 79

#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;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发