Advertisement
deced

Untitled

Dec 23rd, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 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. for I := 0 to High(Matr) do
  41. begin
  42. for J := 0 to High(Matr[0]) do
  43. begin
  44. Write(Matr[I, J]:5);
  45. Write(t, Matr[I, J]:5);
  46. end;
  47. Writeln(t);
  48. Writeln;
  49. end;
  50. Close(t);
  51. Readln;
  52.  
  53. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement