#include<stdio.h>
#include<string.h>
int main()
{
int i,j,k,l,len,max=0,kk,t;
char str[2000],ary[2000],maxstr[2000];
// freopen("F:\\a.txt","r",stdin);
while(scanf("%s",&str)==1)
{
if((str[0]=='E')&&(str[0]=='-')&&(str[0]=='N')&&(str[0]=='-')&&(str[0]=='D'))
break;
l=strlen(str);
kk=0;
for(j=0;j<l;j++)
{
if((str[j]>='A')&&(str[j]<='Z'))
ary[kk++]=str[j]+32;
else if((str[j]>='a')&&(str[j]<='z'))
ary[kk++]=str[j];
else if(str[j]=='-')
ary[kk++]=str[j];
}
ary[kk]='\0';
len=strlen(ary);
if(max<len)
{ max=len;
for(t=0;t<kk;t++)
maxstr[t]=ary[t];
maxstr[t]='\0';
}
}
printf("%s\n",maxstr);
return 0;
}
#include<string.h>
int main()
{
int i,j,k,l,len,max=0,kk,t;
char str[2000],ary[2000],maxstr[2000];
// freopen("F:\\a.txt","r",stdin);
while(scanf("%s",&str)==1)
{
if((str[0]=='E')&&(str[0]=='-')&&(str[0]=='N')&&(str[0]=='-')&&(str[0]=='D'))
break;
l=strlen(str);
kk=0;
for(j=0;j<l;j++)
{
if((str[j]>='A')&&(str[j]<='Z'))
ary[kk++]=str[j]+32;
else if((str[j]>='a')&&(str[j]<='z'))
ary[kk++]=str[j];
else if(str[j]=='-')
ary[kk++]=str[j];
}
ary[kk]='\0';
len=strlen(ary);
if(max<len)
{ max=len;
for(t=0;t<kk;t++)
maxstr[t]=ary[t];
maxstr[t]='\0';
}
}
printf("%s\n",maxstr);
return 0;
}
No comments:
Post a Comment