Guest User

Untitled

a guest
Dec 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. program Project2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils;
  7.  
  8. const
  9. s=100;
  10. var
  11. mass:array [1..s,1..s] of integer;
  12. i,j,n,m:integer;
  13. begin
  14. writeln('Vvedite kol-vo strok i stolbcov: ');
  15. readln (n,m);
  16. randomize;
  17. for i:=1 to n do
  18. for j:=1 to m do
  19. begin
  20. if (i=j) then mass[i,j]:=0
  21. else
  22. mass[i,j]:=random(100)-25;
  23. end;
  24.  
  25. for i:=0 to n do
  26. begin
  27. for j:=0 to m do
  28. if (i=0) then
  29. begin
  30. write('| ',j,' |');
  31. end
  32. else if (j=0) then
  33. begin
  34. write('| ',i,' |');
  35. end
  36. else if (i<>0) and (j<>0) then
  37. if (i=j) then
  38. write('| ',mass[i,j],' |')
  39. else
  40. write('|',mass[i,j],'|');
  41. writeln;
  42. end;
  43. readln;
  44. end.
Add Comment
Please, Sign In to add comment