Program maximal;
const
nmax=100;
var
a:array[1..nmax] of integer;
N,i,max:integer;
begin
readln(N);
max:=0;
for i:=1 to N do
read(a[i]);
if max<a[i] then
max:=a[i];
end;
write(max);
end.
////////
2) Program B;
N,i,z:integer;
z:=0;
if a[i]>0 then
write(a[i],' ');
if a[i]=0 then
z:=z+1;
writeln();
if a[i]<0 then
for i:=1 to z do
write('0',' ')
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Program maximal;
const
nmax=100;
var
a:array[1..nmax] of integer;
N,i,max:integer;
begin
readln(N);
max:=0;
for i:=1 to N do
begin
read(a[i]);
if max<a[i] then
max:=a[i];
end;
write(max);
end.
////////
2) Program B;
const
nmax=100;
var
a:array[1..nmax] of integer;
N,i,z:integer;
begin
readln(N);
z:=0;
for i:=1 to N do
begin
read(a[i]);
if a[i]>0 then
write(a[i],' ');
if a[i]=0 then
z:=z+1;
end;
writeln();
for i:=1 to N do
begin
if a[i]<0 then
write(a[i],' ');
end;
writeln();
for i:=1 to z do
write('0',' ')
end.