Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
123663 | 胡汪兵-小胡老师 | 词组缩写 | C++ | Accepted | 1 MS | 272 KB | 582 | 2025-07-09 08:49:43 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; char str[120]; getchar(); while (n--) { 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 -=32 ; cout << tmp; flag = false; } else if (str[i] == ' ') flag = true; } cout << endl; } }