Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Ada.Text_IO;
- use Ada.Text_IO;
- procedure ejercicio_4 is
- -- Definimos los tipos de datos
- type A is array (0..14) of Integer;
- type B is array (0..2, 0..9) of Float;
- type C is array (Integer range <>) of Float; --<> indica indeterminado
- Array1:A:=(others=>0);
- Array2:B:=(others=>(others=>0.00));
- Array3:C(1..13):=(others=>0.00);
- begin
- --Imprimimos por pantalla el contenido de Array1
- Put_Line("Array1:");
- for I in Array1'Range loop
- Put(Array1(I)'Img);
- end loop;
- Put_Line("");
- --Imprimimos por pantalla el contenido de Array2
- Put_Line("Array2:");
- for I in Array2'Range(1) loop -- recorremos las filas
- for J in Array2'Range(2) loop -- recorremos las columnas
- Put(Array2(I,J)'Img);
- if (J = Array2'Length(2)-1) then -- controlamos salto de fila
- Put_Line("");
- end if;
- end loop;
- end loop;
- Put_Line("");
- --Imprimimos por pantalla el contenido de Array3
- Put_Line("Array3:");
- for I in Array3'Range loop
- Put(Array3(I)'Img);
- end loop;
- end ejercicio_4;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement