Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
80975 sh25_zhangyy 最长单词 C++ 通过 0 MS 248 KB 422 2026-01-04 15:36:53

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; }


测评信息: