#include <stdio.h>
#include <string.h>
main()
{
int c, max, length, position;
char line[1000] = "";
char empty[1000] = "";
char maxline[1000] = "";
max = 0; length = 0; position = 0;
while( (c = getchar() != EOF))
{
if(c != '\n')
{
++length;
line[position] = c;
++position;
}
else
{
if(length > max)
{
max = length;
strcpy(maxline, line);
}
length = 0; strcpy(line, empty); position = 0;
}
}
printf("%d\n%s", max, maxline);
}
계속 0 하나만 출력되네요..어디가 문제인지 잘 모르겠습니다