Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main()
- {
- int len; /* current line length */
- int max; /* maximum length seen so far */
- char line[MAXLINE]; /* current input line */
- char longest[MAXLINE]; /* longest line saved here */
- max = 0;
- while((len = getlines(line, MAXLINE))>0)
- if(len > max){
- max = len;
- copy(longest, line);
- }
- if(max > 0) /* there was a line */
- printf("%s", longest);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement