can someone please confirm that these are correct outputs for 1,2, 3 and 4. i constantly get output limit exceeded. and if i get rid of indentation, i get wa
Code: Select all
program sort(input,output);
var
a : integer;
begin
readln(a);
writeln(a)
end.
program sort(input,output);
var
a,b : integer;
begin
readln(a,b);
if a < b then
writeln(a,b)
else
writeln(b,a)
end.
program sort(input,output);
var
a,b,c : integer;
begin
readln(a,b,c);
if a < b then
if a < c then
if b < c then
writeln(a,b,c)
else
writeln(a,c,b)
else
writeln(c,a,b)
else
if a < c then
writeln(b,a,c)
else
if b < c then
writeln(b,c,a)
else
writeln(c,b,a)
end.
program sort(input,output);
var
a,b,c,d : integer;
begin
readln(a,b,c,d);
if a < b then
if a < c then
if a < d then
if b < c then
if b < d then
if c < d then
writeln(a,b,c,d)
else
writeln(a,b,d,c)
else
writeln(a,d,b,c)
else
if b < d then
writeln(a,c,b,d)
else
if c < d then
writeln(a,c,d,b)
else
writeln(a,d,c,b)
else
if b < c then
writeln(d,a,b,c)
else
writeln(d,a,c,b)
else
if a < d then
if b < c then
else
if b < d then
writeln(c,a,b,d)
else
writeln(c,a,d,b)
else
if b < c then
else
if b < d then
else
if c < d then
writeln(c,d,a,b)
else
writeln(d,c,a,b)
else
if a < c then
if a < d then
if b < c then
if b < d then
if c < d then
writeln(b,a,c,d)
else
writeln(b,a,d,c)
else
if b < c then
if b < d then
writeln(b,d,a,c)
else
writeln(d,b,a,c)
else
if a < d then
if b < c then
writeln(b,c,a,d)
else
writeln(c,b,a,d)
else
if b < c then
if b < d then
if c < d then
writeln(b,c,d,a)
else
writeln(b,d,c,a)
else
writeln(d,b,c,a)
else
if b < d then
writeln(c,b,d,a)
else
if c < d then
writeln(c,d,b,a)
else
writeln(d,c,b,a)
end.