1 条题解
-
0
#include<bits/stdc++.h> using namespace std; int main(){ int t=0,maxx=INT_MIN; string s,g; getline(cin,s); s.erase(s.size()-1); s=s+' '; for(int i=0;i<s.size();i++){ if(s[i]!=' ') t++; else{ string k=s.substr(i-t,t); if(k.find('a')!=-1&&maxx<t) maxx=max(maxx,t),g=k; t=0; } } if(!g.empty()) cout<<g; else cout<<"NO"; return 0; }
- 1
信息
- ID
- 4810
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 10
- 标签
- (无)
- 递交数
- 1
- 已通过
- 1
- 上传者