# Include <iostream> # include <algorithm> # include <stdio. h> # include <stdlib. h> # include <string. h> # include <queue> # include <math. h >#include <set ># include <vector> # define maxn 15 # define INF 1000int main () {int I, j, n, m, T, C; int first [maxn]; int U [maxn], V [maxn], W [maxn], next [maxn]; scanf ("% d", & N, & M); for (I = 0; I <= N; I ++) first [I] =-1; for (I = 0; I <m; I ++) {scanf ("% d", & U [I], & V [I]); // U is the end of the arc, V arc header next [I] = first [U [I]; // firs T [U [I] = I; // very short! } // Added after your understanding. For (I = 1; I <= N; I ++) {If (first [I] =-1) {printf ("no adjacent table starting with vertex <% d>. \ N ", I); continue;} printf (" an adjacent table starting from a vertex <% d>: \ n ", I ); for (j = first [I]; J! =-1; j = next [J]) {printf ("<% d>", I, V [J]);} printf ("\ n");} return 0 ;}