Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
77857 sh25_wangtaojie 最长单词 C++ 通过 0 MS 256 KB 424 2025-12-26 14:54:36

Tests(3/3):


#include <iostream> #include <string> #include <sstream> using namespace std; int main() { string sentence; getline(cin, sentence); sentence.pop_back(); // 去除句号 stringstream ss(sentence); string word; string longest; while (ss >> word) { if (word.length() > longest.length()) { longest = word; } } cout << longest; return 0; }


测评信息: