program douazecisiunu; var i,n,m,j,x,y:integer; a:array[1..30,1..30] of integer; f:text; begin assign(f,'graf.txt'); reset(f); readln(f,n,m); for i:=1 to n do for j:=1 to n do a[i,j]:=0; for i:= 1 to m do begin readln(f,x,y); a[x,y]:=1; a[y,x]:=1; end; close(f); writeln('matricea de adiacenta este '); writeln; for i:= 1 to n do begin for j:=1 to n do write(a[i,j],' '); writeln; end; writeln; writeln('listele de adiacenta sunt '); writeln; for i:= 1 to n do begin write('lista nodului ',i,' este '); for j:=1 to n do if a[i,j]=1 then write(j,' '); writeln; end; readln; end. readln; end.