2 solutions

  • 3
    @ 2024-8-23 10:16:54
    #include<bits/stdc++.h>
    using namespace std;
    const int N=110;
    char s[N];
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=0;i<n;i++)
    	{
    		cin>>s;
    		int m=strlen(s);
    		if(s[0]>='a'&&s[0]<='z')
    		{
    			s[0]-=32;
    		}
    		for(int j=1;j<m;j++)
    		{
    			if(s[j]>='A'&&s[j]<='Z')
    			{
    				s[j]+=32;
    			}
    		}
    		cout<<s<<endl;
    	}
    	return 0;
    }
    
    • -6
      @ 2024-11-2 11:25:43

      0

      • 1

      Information

      ID
      918
      Time
      1000ms
      Memory
      256MiB
      Difficulty
      1
      Tags
      (None)
      # Submissions
      50
      Accepted
      29
      Uploaded By