program Lab3; uses crt; var tab:array [1..5,1..5] of integer; pob:array [1..5] of integer; por:array [1..5] of integer; a,b,chislo:integer; BEGIN clrscr; a := 1; while a <= 5 do begin b := 1; while b <= 5 do begin if a=b then tab[a,b]:=0 else repeat write('Vvedite znachenie yacheyki (',a,',',b,'): '); readln(tab[a,b]); if (tab[a,b]<0) or (tab[a,b]>2) then writeln('Nevernoe znachenie. Povtorite eshe raz.'); until (tab[a,b] >= 0) and (tab[a, b] <= 2); inc(b); end; inc(a); end; writeln; writeln('Poluchennaya matritsa:'); a := 1; while a <= 5 do begin writeln(tab[a,1],' ',tab[a,2],' ',tab[a,3],' ',tab[a,4],' ',tab[a,5]); inc(a); end; a := 1; while a <= 5 do begin pob[a]:=0; por[a]:=0; b := 1; while b <= 5 do begin if a<>b then begin if tab[a,b]=0 then por[a]:=por[a]+1; if tab[a,b]=2 then pob[a]:=pob[a]+1; end; inc(b); end; inc(a) end; chislo:=0; a := 1; while a <= 5 do begin if pob[a]>por[a] then chislo:=chislo+1; inc(a); end; writeln; writeln('Chislo komand, u kotoryh pobed bolshe, chem porazheniy, ravno ',chislo); readln; END.