Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
430990 赵晗博 【C5-7】找最长单词 C++ 通过 100 8 MS 252 KB 332 2026-03-06 20:26:57

Tests(2/2):


#include<bits/stdc++.h> using namespace std; int main(){ string a,b; int ma=0; while(cin>>a) { int l=a.size(); if(a[l-1]=='.') { a.erase(l-1); } if(a.size()>ma && a.find("a")!=-1) { ma=a.size(); b=a; } } if(b=="") { cout<<"NO"; } else { cout<<b; } return 0; }


测评信息: