题解 | #首字母大写#
首字母大写
https://www.nowcoder.com/practice/91f9c70e7b6f4c0ab23744055632467a
#include <bits/stdc++.h>
using namespace std;
bool isBlank(char c){
if(c == ' ' || c == '\t' || c == '\r' || c == '\n')return 1;
return 0;
}
int main() {
string s;
while(getline(cin,s)){
for(int i =0;i<s.length();i++){
if(islower(s[i])){
if(i == 0 || isBlank(s[i-1]))
s[i] -= 'a'-'A';
}
}
cout<<s<<endl;
}
}
// 64 位输出请用 printf("%lld")

