Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. program laba2_2;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. {$R *.res}
  6.  
  7. uses
  8. System.SysUtils;
  9.  
  10. var
  11. size: integer;
  12. cols: integer;
  13. rows: integer;
  14. nums1: array of array of integer;
  15. nums2: array of array of integer;
  16. numsSum: array of array of integer;
  17. isCorrect: boolean;
  18.  
  19.  
  20. procedure inputSize(size: integer);
  21.  
  22. const
  23. minSize = 2;
  24. maxSize = 1000;
  25. begin
  26. isCorrect := false;
  27. repeat
  28. Writeln('Введите размерность матрицы от', minSize, ' до ', maxSize,':');
  29. try
  30. Readln(size);
  31. if (size > minSize - 1) and (size < maxSize) then
  32. isCorrect := true
  33. else
  34. Writeln('Ошибка ввода. Введено число, удовлетворяющее условию.');
  35. except
  36. Writeln('Ошибка ввода. Введено число, удовлетворяющее условию.');
  37. end;
  38. until isCorrect;
  39. end;
  40.  
  41.  
  42. procedure inputMatr();
  43. begin
  44. SetLength(nums1, size, size);
  45. for rows := 1 to size - 1 do
  46. for cols := 0 to rows - 1 do
  47. nums1[rows, cols] := 0;
  48. for rows := 0 to size - 1 do
  49. for cols := rows to size - 1 do
  50. begin
  51. Writeln('Введите элемент матрицы [', rows + 1, ', ', cols + 1, ']: ');
  52. Read(nums1[rows, cols]);
  53. end;
  54. end;
  55.  
  56.  
  57. function outputMatr(): integer;
  58. begin
  59. for rows := 0 to size - 1 do
  60. for cols := 0 to size - 1 do
  61. Writeln(nums1[rows, cols]);
  62. end;
  63.  
  64. begin
  65. readln;
  66. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement