масив для пошуку 23, 89, 54, 34, 98, 56, 99, 12, 34, 89, 32 даю 20 балов
Приложения:
Аноним:
Язык?
Ответы
Ответ дал:
1
Ответ:
Pascal
program FindMaxElement;
uses crt;
var
A : array[1..11] of Integer = (23, 89, 54, 34, 98, 56, 99, 12, 34, 89, 32);
Max : Integer;
Index : Integer;
begin
clrscr;
Max := A[1];
for Index := 1 to Length(A) do
begin
if (Max < A[Index]) then
Max := A[Index]
end;
write(Max);
end.
Python
A = [23, 89, 54, 34, 98, 56, 99, 12, 34, 89, 32]
Max = A[0]
for Element in A:
if Element > Max:
Max = Element
print(Max)
JS
const A = [23, 89, 54, 34, 98, 56, 99, 12, 34, 89, 32];
let Max = A[0];
for (let Index = 0; Index < A.length; Index++) {
if (Max < A[Index]) {
Max = A[Index]
}
}
console.log(Max);
Вас заинтересует
1 год назад
1 год назад
3 года назад
8 лет назад