Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
123660 | 胡汪兵-小胡老师 | 词组缩写 | C++ | Accepted | 2 MS | 272 KB | 570 | 2025-07-09 08:46:02 |
#include<bits/stdc++.h> using namespace std; int main() { int t; cin >> t; char str[120]; getchar(); while (t--) { cin.getline(str, 120); bool flag = true; for (int i = 0; str[i] != '\0'; i++) { if (flag&&str[i] != ' ') { char tmp = str[i]; if (str[i] >= 'a'&&str[i] <= 'z')tmp += 'A' - 'a'; cout << tmp; flag = false; } else if (str[i] == ' ')flag = true; } cout << endl; } }