Canon/open_set/44_reverse_output.pas

26 lines
273 B
ObjectPascal
Raw Normal View History

2024-03-09 20:11:27 +08:00
program main;
var
i: integer;
procedure reverse(n: integer);
var
next: integer;
begin
if n <= 1 then
begin
read(next);
write(next);
end
else
begin
read(next);
reverse(n - 1);
write(next);
end;
end;
begin
i := 200;
reverse(i);
end.