Simply the solution for four with the reverse keyword
Can't believe I forgot about it
This commit is contained in:
parent
31b9b5b91b
commit
a11230372e
9
four.adb
9
four.adb
|
@ -49,13 +49,9 @@ procedure Four is
|
|||
|
||||
Highest_Palindrome : Natural := 0;
|
||||
begin
|
||||
for Offset in 0 .. Ceiling loop
|
||||
for N in reverse 1 .. Ceiling loop
|
||||
for J in reverse 1 .. Ceiling loop
|
||||
declare
|
||||
N : constant Natural := Ceiling - Offset;
|
||||
begin
|
||||
for Sub_Offset in 0 .. Ceiling loop
|
||||
declare
|
||||
J : constant Natural := Ceiling - Sub_Offset;
|
||||
Product : constant Natural := J * N;
|
||||
Bailout : constant Boolean := Is_Palindrome (Product);
|
||||
begin
|
||||
|
@ -66,7 +62,6 @@ begin
|
|||
end if;
|
||||
end;
|
||||
end loop;
|
||||
end;
|
||||
end loop;
|
||||
|
||||
New_Line;
|
||||
|
|
Loading…
Reference in New Issue