1
0
mirror of https://github.com/krislamo/knrc.git synced 2025-09-11 16:39:28 +00:00

Exercise 1-17. Print input lines greater than 80

This commit is contained in:
2021-11-30 00:04:36 -05:00
parent f254c6e67e
commit 42a0b5413b

View File

@@ -1,5 +1,6 @@
#include <stdio.h>
#define MAXLINE 1000 /* maximum input line size */
#define MINLINE 81
int getline(char line[], int maxline);
void copy(char to[], char from[]);
@@ -21,13 +22,9 @@ main()
if (c == '\n')
++len;
}
if (len > max) {
max = len;
copy(longest, line);
}
if (len >= MINLINE)
printf("%s", line);
}
if (max > 0)
printf("%s", longest);
return 0;
}