1 條題解

  • 0
    @ 2026-1-24 9:11:47
    #include<bits/stdc++.h>
    using namespace std;
    string s;
    int a;
    int main(){
    	cin>>a;
    	for(int i = 0;i<a;i++){
    		cin>>s;
    		if(s[0]>='a'&&s[0]<='z') s[0]-=32;
    		for(int j=1;j<(int)s.size();j++){
    			if(s[j]>='A'&&s[j]<='Z') s[j]+=32;
    		}
    		cout<<s<<endl;
    	}
    	return 0;
    }
    

    資訊

    ID
    339
    時間
    1000ms
    記憶體
    256MiB
    難度
    10
    標籤
    遞交數
    4
    已透過
    2
    上傳者