求助,为什么错了
查看原帖
求助,为什么错了
1509022
tymelody楼主2024/12/17 15:17
#include<bits/stdc++.h>

using namespace std;

void cver(char*str)
{
    if(islower(str[0]))str[0]=toupper(str[0]);
    
    for(int i=1;i<strlen(str);i++)
    {
        if(isupper(str[i]))str[i]=tolower(str[i]);
    }
    
}
char s[30];
int main()
{
    int n;
    cin>>n;
    
    while(n--)
    {
        cin.getline(s,30);
        cver(s);
        for(int i=0;i<strlen(s);i++)
        {
            cout<<s[i];
        }
        cout<<endl;
    }
    return 0;
}
2024/12/17 15:17
加载中...