//Aaron Baymiller
//CPSC 1011 Section 001 Spring 2023
//Lab Number 6
//In this lab, we are first setting the maximum lines to write down is 200, and the maximum length of each line is 100 characters. Then we use the fgets command to be able to get lines from the poe-raven text. We get more than one line by using fgets in a while loop.

#include <stdio.h>
#include <string.h>

int main (void){

const int  MAX_LINE=200, MAX_LINE_LEN=100;
char line_in[MAX_LINE_LEN];
int run=1, count=0;

while (run==1){
if  (fgets(line_in, MAX_LINE, stdin)==NULL){
        run=0;
}
else{
	count++;
}}
printf("This poem has %d lines.\n", count);

rewind(stdin);
run=1;


while (run==1){
if (fgets(line_in, MAX_LINE, stdin)==NULL){
	run=0;
}
else {
	printf(" %s", line_in);
}
}
}
