ALGO-84 大小寫轉換——字符串的大小寫轉換

這裏是引用

AC代碼:

#include<bits/stdc++.h>

using namespace std; 

int main(){
	string a;
	getline(cin , a);

	for(int i=0; i<a.length(); i++){
		int temp = a[i];
		if( temp >= 65 && temp <= 91){
			printf("%c", temp+32);
		}
		if( temp >= 97 && temp <= 123){
			printf("%c", temp-32);
		}
	}
	
	return 0;
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章