3 条题解

  • 1
    @ 2023-1-4 15:35:55
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	ios::sync_with_stdio(false);
    	cin.tie(0);
    	cout.tie(0);
        int n;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            string str;
            cin>>str;
            if(str[0]>='a'&&str[0]<='z')
            {
                str[0]-=32;
                for(int j=1;j<str.size();j++)
                {
                    if(str[j]>='A'&&str[j]<='Z')
                        str[j]+=32;
                }
                cout<<str<<endl;
            }
            else if(str[0]>='A'&&str[0]<='Z')
            {
                for(int j=1;j<str.size();j++)
                {
                    if(str[j]>='A'&&str[j]<='Z')
                        str[j]+=32;
                }
                cout<<str<<endl;
            }
            else
            {
                for(int j=1;j<str.size();j++)
                {
                    if(str[j]>='A'&&str[j]<='Z')
                        str[j]+=32;
                }
                cout<<str<<endl;
            }
        }
        return 0;
    }
    

    信息

    ID
    1154
    时间
    1000ms
    内存
    128MiB
    难度
    6
    标签
    递交数
    182
    已通过
    62
    上传者