Enter multiple lines of information in the terminal, locate the line containing "Ould", and print the line. #include <stdio.h> #define max 1000int getline (char line[]) { int limit = max - 1; int ch = 0; int i = 0; while ((Ch = getchar ()) && (--limit) && ch != ' \ n ' &&ch != eof) { line[i] = ch; i++; } if ( ch == ' \ n ') { line[i++] = ' \ n '; } line[i] = '; return i;} Char *my_strstr (Char line[], char *match) { int i, j, k; for (i = 0; line[i] != '; i++) { for (j = 0, k = i; match[j] != ' &&line[k] == match[j]; k++, j++) { ; } if (j > 0 && (match[j] == ')) { return &line[i]; } } return null;} Int main () { char line[max]; char *p = "Ould"; while (Getline (line )) { if (My_strstr (line, p)) { printf ("%s", line); } } return 0;}
Enter multiple lines of information in the terminal, locate the line containing "Ould", and print the line.