Bàitoántìmduongdingannhatgiua2diembatkì trên do thi. uses crt; var a:array[1 20,1 20] of integer; b:array[1 20] of boolean; d,c:array[1 20] of byte; i,n,da,cu,dem,dem1:byte;dd,min:integer; procedure docfile; var f:text;i,j:byte; begin assign(f,'ipngann.pas'); reset(f); readln(f,n); for i:=1 to n do begin for j:=1 to n do read(f,a[i,j]); readln(f); end; readln(f,da,cu); End; {---------------------------------------------------------------} procedure timduong(v:byte); var i,l:byte; begin for i:=1 to n do if (a[v,i]<>0 ) and (b[i]=true) then begin c[dem]:=i; b[i]:=false; dem:=dem+1;dd:=dd+a[v,i]; if i=cu then begin {for l:=1 to dem-1 do write(c[l]:3);} if dd<min then begin min:=dd;d:=c;dem1:=dem;end; dem:=2;dd:=0; end else timduong(i); b[i]:=true; end; end; {---------------------} BEGIN clrscr; docfile; dd:=0; min:=10000; for i:=1 to n do b[i]:=true; b[da]:=false; c[1]:=da;dem:=2; timduong(da); writeln('quang duongngan nhat=',min);for i:=1 to dem1-1 do write(d[i]:3); readln; END. . Bài toán tìm duong di ngan nhat giua 2 diem bat kì trên do thi. uses crt; var a:array[1. .20 ,1. .20 ] of integer; b:array[1. .20 ] of boolean;. var a:array[1. .20 ,1. .20 ] of integer; b:array[1. .20 ] of boolean; d,c:array[1. .20 ] of byte; i,n,da,cu,dem,dem1:byte;dd,min:integer; procedure docfile; var