Programa.dpr 699 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. program Programa;
  2. {$APPTYPE CONSOLE}
  3. type
  4. TMatriz = array[1..3, 1..4] of Integer;
  5. var
  6. Matriz: TMatriz;
  7. x, y: Integer;
  8. begin
  9. for x := 1 to 3 do
  10. begin
  11. for y := 1 to 4 do
  12. begin
  13. Write('Ingrese el valor del elemento de la matriz [', x, '][', y, ']: ');
  14. ReadLn(Matriz[x, y]);
  15. end;
  16. end;
  17. Write('Primer fila de la matriz');
  18. for y := 1 to 4 do
  19. begin
  20. write(Matriz[1, y]:6); { Muestra solo 6 dígitos }
  21. end;
  22. WriteLn;
  23. Write('Última fila de la matriz:');
  24. for y := 1 to 4 do
  25. begin
  26. Write(Matriz[3, y]:6);
  27. end;
  28. WriteLn;
  29. Write('Primera columna de la matriz:');
  30. for x := 1 to 3 do
  31. begin
  32. Write(Matriz[x, 1]:6);
  33. end;
  34. ReadLn;
  35. end.