#include
#define M 20
int getline(char line[ ]); //获得字符串
void cpystr(char longest[ ], char line[ ]); //将最长的字符串复制到 longest[ ]中
int main()
{
char line[M],longest[M];
int len;
int max=0;
while((len=getline(line))>0) // this statement test if there is another line
{
if(len>max)
{
max=len;
cpystr(longest,line);
}
}
if(max>0)
printf("%d\t%s\n",max,longest); //line[] and longest must be the char type here
else printf("please input a line\n"); // in case of error here
return 0;
}
int getline(char line[])
{
int i;
int c;
for(i=0;i |