Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 478 Bytes

C++把字符串中的大小写字母替换.md

File metadata and controls

18 lines (15 loc) · 478 Bytes

在这里插入图片描述

#include <iostream>
using namespace std;

int main(){
	string str;
	cin>>str;
	for(int i=0;i<str.length();i++){
		if(str[i]>='A'&&str[i]<='Z') str[i]+=32;
		else str[i]-=32;
	}
	cout<<str<<endl;
	return 0;
}