SHARE
TWEET

Untitled

a guest Oct 22nd, 2019 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var
  2.   n,i,j:integer;
  3.   u,v,w:integer;
  4.   graph: array [1..100,1..100] of integer;
  5.   table: array [1..100,1..100] of integer;
  6. begin
  7.   read(n);
  8.   for i:=1 to n do
  9.   begin
  10.     read(u,v,w);
  11.     graph[u][v]:=w;
  12.   end;
  13.   for i := 1 to n do
  14.   begin
  15.     for j:= 1 to n do
  16.     begin
  17.       if (graph[i][j] <> 0)  then
  18.         table[i][j] := graph[i][j];
  19.     end;
  20.   end;
  21.   println('table');
  22.   for i := 1 to n do
  23.   begin
  24.     for j:= 1 to n do
  25.     begin
  26.       print(table[i][j]);
  27.     end;
  28.     println;
  29.   end;
  30. end.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top