Var
N,A:integer;
Begin
Write('N = ');Read(N);
A:=0;
While N>0 do
if (N mod 10) > A then A:= N mod 10;
N:=N div 10;
End;
Write(A)
End.
N,A,B:integer;
C:boolean;
A:=-1;
B:=-2;
C:=false;
if A=B then C:=true;
if N>0 then
A:=N mod 10;
B:=N mod 10;
if C then Write('Есть')
else Write('Нет')
Подробнее - на -
program max_elementarray ;
var i, max : integer ;
a : array [1..10] of integer;
begin
for i : = 1 to 10 do
readln(a[i]);
end;
max : = a[1];
for i : = 2 to 10 do
if a[i]> max then max : = a[i];
writeln('max element of array = ',max) ;
readln ;
end.
Var
N,A:integer;
Begin
Write('N = ');Read(N);
A:=0;
While N>0 do
Begin
if (N mod 10) > A then A:= N mod 10;
N:=N div 10;
End;
Write(A)
End.
Var
N,A,B:integer;
C:boolean;
Begin
Write('N = ');Read(N);
A:=-1;
B:=-2;
C:=false;
While N>0 do
Begin
if A=B then C:=true;
if N>0 then
Begin
A:=N mod 10;
N:=N div 10;
End;
if A=B then C:=true;
if N>0 then
Begin
B:=N mod 10;
N:=N div 10;
End;
End;
if A=B then C:=true;
if C then Write('Есть')
else Write('Нет')
End.
Подробнее - на -
program max_elementarray ;
var i, max : integer ;
a : array [1..10] of integer;
begin
for i : = 1 to 10 do
begin
readln(a[i]);
end;
max : = a[1];
for i : = 2 to 10 do
if a[i]> max then max : = a[i];
writeln('max element of array = ',max) ;
readln ;
end.