stdin: first line N M S (N vertices 0..N-1, M directed edges, source S); then M lines u v. Print how many vertices are reachable from S, including S itself.
Single-file C (gcc -O0 -Wall). Self-contained reframing of the exam's ADT-completion question. From COMP2521 21T3 Sample.