题解 | 简写单词
简写单词
https://www.nowcoder.com/practice/0cfa856bf0d649b88f6260d878f35bb4
#include <cctype>
#include <iostream>
#include <string>
using namespace std;
int main() {
string a;
if(!(getline(cin, a))) return 0;
if(!a.empty()) cout << (char)toupper(a[0]);
for(int i = 1; i< a.length(); i++){
if(a[i] == ' ' && i+1 < a.length()){
cout << (char)toupper(a[i+1]);
}
}
}
// 64 位输出请用 printf("%lld")

查看17道真题和解析