/* minizoo.c Jeff Ondich, 24 Oct 2025 Intended to help us discuss the zoo escape assignment structure (and to illustrate sscanf). Compile this for easy gdb use: gcc -g -Wall -Werror -O1 -fno-pie -no-pie -fno-stack-protector -o minizoo minizoo.c Then you can either just run this program (./minizoo) or open it with gdb (gdb minizoo). */ #include int phase1(char *s) { int a, b; if (sscanf(s, "%d %d", &a, &b) != 2) { return 0; } return (a + b == 19); } int main() { char input[32]; printf("Enter the magic string: "); if (fgets(input, 32, stdin) != NULL) { if (phase1(input)) { printf("You win!\n"); } else { printf("Curses! Foiled again!\n"); } } else { fprintf(stderr, "fgets had a problem\n"); } return 0; }