Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
101953 Tom0 单词排序 C++ 通过 100 0 MS 256 KB 425 2023-09-11 14:38:22

Tests(5/5):


#include <iostream> #include <algorithm> using namespace std; typedef long long LL; string s, t, ans[105]; int n; int main() { getline(cin, s); for (int i = 0; i < s.size(); i++) if (isalpha(s[i])) t += s[i]; else { ans[++n] = t; t = ""; } sort(ans + 1, ans + n + 1); cout << n << endl; for (int i = 1; i <= n; i++) cout << ans[i] << endl; return 0; }


测评信息: