/*Princess Ellerbe
 * 3/3/23
 * Section 001
 * Lab 6
 * This program reads a file into a 2D array and prints the array and the number of lines read
*/

#include <stdio.h>

#define MAX_LINE 200
#define MAX_LINE_LEN 100

int main() {
    char lines[MAX_LINE][MAX_LINE_LEN]; 
    int num_lines = 0; 

    while (fgets(lines[num_lines], MAX_LINE_LEN, stdin)) {
        num_lines++; 
    }

    printf("This poem has %d lines.\n", num_lines); 

    for (int i = 0; i < num_lines; i++) {
        printf("%s", lines[i]);
    }

    return 0;
}
