#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
using namespace std;
char st[600];
int main()
{
int i,len,cnt=0,max=0,max_op;
gets(st);
len=strlen(st);
for(i=0;i<len;i++)
{
if(st[i]!=' '&&st[i]!='.')
cnt++;
else
{
if(cnt>max)
{
max=cnt;
max_op=i-cnt;
}
cnt=0;
}
}
for(i=max_op;i<max_op+max;i++)
cout<<st[i];
return 0;
}100'
1149:最长单词2
最新推荐文章于 2024-03-04 20:28:28 发布