Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with Arrays;
- use Arrays;
- function Fila_Mayor_Peso (Var : Matriz_1) return Integer is
- Fila, Index_Fila : Integer;
- Aux : Integer := Integer'First;
- begin
- -- Establecemos un for que recorra las filas
- for i in Var'Range (1) loop
- Fila := 1;
- -- Con este for recorremos las columnas
- for j in Var'Range (2) loop
- Fila := Fila + Var (i, j);
- end loop;
- -- Con esto vamos almacenando la fila de mayor peso
- -- que vayamos encontrando hasta haber comprobado todas
- if Fila > Aux then
- -- Si la fila es mayor que la que previamente tenemos en
- -- la Variable auxiliar entonces la almacenamos en Aux
- Index_Fila := i;
- Aux := Fila;
- end if;
- end loop;
- return Index_Fila;
- end Fila_Mayor_Peso;
Add Comment
Please, Sign In to add comment