with Ada.Text_IO; use Ada.Text_IO;
with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
procedure Q5G is
N : Integer; -- Número de elementos no array
A : array (1 .. 100) of Integer; -- Array para armazenar os números
Max_Value : Integer; -- Variável para armazenar o maior valor
begin
-- Leitura do número de elementos
Put_Line("Digite o número de elementos (até 100):");
Get(N);
-- Leitura dos elementos do array
Put_Line("Digite os elementos:");
for I in 1 .. N loop
Get(A(I));
end loop;
-- Inicializa o maior valor com o primeiro elemento do array
Max_Value := A(1);
-- Encontra o maior valor no array
for I in 2 .. N loop
if A(I) > Max_Value then
Max_Value := A(I);
end if;
end loop;
-- Exibe o maior valor encontrado
Put_Line("O maior valor é: " & Integer'Image(Max_Value));
end Q5G;
d2l0aCBBZGEuVGV4dF9JTzsgdXNlIEFkYS5UZXh0X0lPOwp3aXRoIEFkYS5JbnRlZ2VyX1RleHRfSU87IHVzZSBBZGEuSW50ZWdlcl9UZXh0X0lPOwoKcHJvY2VkdXJlIFE1RyBpcwogICBOIDogSW50ZWdlcjsgIC0tIE7Dum1lcm8gZGUgZWxlbWVudG9zIG5vIGFycmF5CiAgIEEgOiBhcnJheSAoMSAuLiAxMDApIG9mIEludGVnZXI7ICAtLSBBcnJheSBwYXJhIGFybWF6ZW5hciBvcyBuw7ptZXJvcwogICBNYXhfVmFsdWUgOiBJbnRlZ2VyOyAgLS0gVmFyacOhdmVsIHBhcmEgYXJtYXplbmFyIG8gbWFpb3IgdmFsb3IKCmJlZ2luCiAgIC0tIExlaXR1cmEgZG8gbsO6bWVybyBkZSBlbGVtZW50b3MKICAgUHV0X0xpbmUoIkRpZ2l0ZSBvIG7Dum1lcm8gZGUgZWxlbWVudG9zIChhdMOpIDEwMCk6Iik7CiAgIEdldChOKTsKCiAgIC0tIExlaXR1cmEgZG9zIGVsZW1lbnRvcyBkbyBhcnJheQogICBQdXRfTGluZSgiRGlnaXRlIG9zIGVsZW1lbnRvczoiKTsKICAgZm9yIEkgaW4gMSAuLiBOIGxvb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