1 solutions

  • 0
    @ 2025-11-5 18:32:26

    C++ :

    #include <iostream>
    #include <cstdio>
    #include <cstring>
    using namespace std;
    const int N = 100010;
    
    int main(){
    	
    	string s[101] , tmp;
    	int n;
    	cin >> n;
    	for(int i = 1 ; i <= n ; ++i) cin >> s[i];
    	for(int i = 1 ; i <= n ; i++){
    		tmp = s[i];
    		if(tmp[0] >= 'a' && tmp[0] <= 'z') tmp[0] = tmp[0] - 32;
    		for(int j = 1 ; j < tmp.size() ; j++){
    			if(tmp[j] >= 'A' && tmp[j] <= 'Z') tmp[j] = tmp[j] + 32;
    		}
    		s[i] = tmp;
    	}
    	
    	for(int i = 1 ; i <= n ; i++) cout << s[i] << endl;
    	
    	
    	
    	return 0;
    }
    
    • 1

    Information

    ID
    18917
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By