Fraction reduction: Difference between revisions

Content deleted Content added
No edit summary
Line 72: Line 72:
=={{header|Ada}}==
=={{header|Ada}}==
{{trans|Python}}
{{trans|Python}}
<lang Ada>with Ada.Integer_Text_IO;
<lang Ada>with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
with Ada.Text_IO; use Ada.Text_IO;
procedure Fraction_Reduction is
procedure Fraction_Reduction is
Line 78: Line 78:
type Int_Array is array (Natural range <>) of Integer;
type Int_Array is array (Natural range <>) of Integer;


procedure Put (Item : Integer;
Width : Field := 0; -- Override default width
Base : Number_Base := Ada.Integer_Text_IO.Default_Base)
renames Ada.Integer_Text_IO.Put;
function indexOf(haystack : Int_Array; needle : Integer) return Integer is
function indexOf(haystack : Int_Array; needle : Integer) return Integer is
idx : Integer := 0;
idx : Integer := 0;
Line 134: Line 129:
(others => (others => 0));
(others => (others => 0));
begin
begin
Ada.Integer_Text_IO.Default_Width := 0;
for i in lims'Range loop
for i in lims'Range loop
declare
declare