U214446 单词校对 请教大佬

题目总版

mao13588607991 @ 2024-11-05 22:26:13


by Diary_Of_Young @ 2024-11-13 16:41:21

#include<bits/stdc++.h>
using namespace std;

int main()
{
    string s;
    getline(cin, s);
    if(s[0] >= 'a') s[0] -= 32;
    for(int i = 1 ; i < s.size() ; i ++) 
    if(s[i] >= 'A' && s[i] <= 'Z')  s[i] += 32;

    cout << s;
    return 0;
}

|