算法1
(暴力枚举) $O(n^2)$
blablabla
时间复杂度
参考文献
C++ 代码
#include<bits/stdc++.h>
using namespace std;
string st,str;
int c,mx,s;
int main()
{
while(cin>>st){
c=st.size();
if(st[c-1]=='.'){
c--;
st.erase(c,1);
s=1;
}
if(c>mx){
str=st;
mx=c;
}
if(s)break;
}
cout<<str;
}
这是我自己写的,和你差不多意思吧,就是会把最后的点也读入进去,可以帮我指正一下嘛?
句号。