#include <stdio.h>
#include <conio.h>
int main()
{
int i, gnli[50], j, k, ll[20], max;
char string[1000], ch;
for(i=0; i<=49; i++)
{
gnli[i]=0;
}
printf("Enter data and press \'Esc\' when you complete typing.");
i=0;
j=1;
gnli[0]=-1;
while(ch!=27)
{
ch=getche();
string[i]=ch;
if(ch==13)
{
printf("\n");
i--;
gnli[j]=i;
j++;
}
i++;
}
gnli[j]=i-2;
printf("\n");
printf("\n");
i=0;
printf("\n");
printf("\n");
for(k=0; k<=j; k++)
{
ll[i]=(gnli[k+1]-gnli[k]);
//printf("%d\n", ll[i]);
i++;
}
max=ll[0];
for(k=0; k<=j; k++)
{
if(max<ll[k])
{
max=ll[k];
i++;
}
}
printf("Leanght of largest line is: %d", max);
getch();
}