Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
158479 格林老师 词组缩写 C++ Accepted 1 MS 272 KB 541 2026-08-22 10:52:52

Tests(1/1):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int T; cin>>T; cin.ignore(); while(T--){ string s; getline(cin,s); bool first=true; string new_s; for (int i=0;i<s.size();i++){ if (s[i]==' '){ first=true; } else{ if (first==true){ new_s+=toupper(s[i]); first=false; } } } cout<<new_s<<"\n"; } }