Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
151589 Kevin 词组缩写 C++ Accepted 1 MS 276 KB 451 2026-04-15 09:38:08

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string s; int n; cin>>n; cin.ignore(); for(int i=1;i<=n;i++){ int cnt=0; getline(cin,s); int len=s.size(); for(int j=0;j<len;j++){ if(s[j]!=' '){ if(cnt==0){ if(s[j]>='a'&&s[j]<='z'){ cout<<char(s[j]-32); } else{ cout<<s[j]; } cnt++; } } else{ cnt=0; } } cout<<endl; } return 0; }