文章

116

粉丝

0

获赞

119

访问

6.4k

头像
字符串的反码 题解:
P1364 吉林大学机试题
发布于2026年1月30日 15:20
阅读数 68

#include<bits/stdc++.h>
using namespace std;

int main(){
	string str;
	while(getline(cin, str)){
		if(str == "!")
			return 0;
		else{
			for(char c:str){
				if(c >= 'a' && c <= 'z'){
					c = 'z'-c+'a';
				}else if(c >= 'A' && c <= 'Z'){
					c = 'Z'-c+'A';
				}else
					c = c;
				cout << c;
			}	
			cout << endl;
		}	
	}	
}	

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发