Advertisement
deced

Untitled

Dec 23rd, 2020
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. type
  2. Vec = array [0 .. 2] of Real;
  3.  
  4. const
  5. Arr: Vec = (12, 134, 1);
  6.  
  7. var
  8. I, J: Byte;
  9. t: Text;
  10. Matr: array [0 .. 2] of array [0 .. 4] of integer;
  11.  
  12. begin
  13. assign(t, 'out.pas');
  14. rewrite(t);
  15. Writeln('Одномерный массив: ');
  16. Writeln(t, 'Одномерный массив: ');
  17. for I := 0 to High(Arr) do
  18. begin
  19. Write(Arr[I]:5:2);
  20. Write(t, Arr[I]:5:2);
  21. if (I <> High(Arr)) then
  22. begin
  23. Write(', ');
  24. Write(t, ', ');
  25. end;
  26. end;
  27. Writeln;
  28. Writeln('Введите элементы двумерного массива');
  29. for I := 0 to High(Matr) do
  30. begin
  31. for J := 0 to High(Matr[0]) do
  32. begin
  33. Write('Matr[', I, ',', J, '] = ');
  34. Readln(Matr[I, J]);
  35. end;
  36. end;
  37. Writeln;
  38. Writeln('Двумерный массив: ');
  39. Writeln(t);
  40. Writeln(t, 'Двумерный массив: ');
  41. for I := 0 to High(Matr) do
  42. begin
  43. for J := 0 to High(Matr[0]) do
  44. begin
  45. Write(Matr[I, J]:5);
  46. Write(t, Matr[I, J]:5);
  47. end;
  48. Writeln(t);
  49. Writeln;
  50. end;
  51. Close(t);
  52. Readln;
  53.  
  54. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement