-- $Id: strcat.gnat,v 1.0 2003/11/18 12:15:00 dada Exp $
-- http://dada.perl.it/shootout
-- contributed by James S. Rogers
with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
with Ada.Text_Io; use Ada.Text_Io;
with Ada.Integer_text_Io; use Ada.Integer_Text_Io;
procedure Strcat is
N: Integer;
Hello : String := "hello" & Ascii.Lf;
Buffer : Unbounded_String := Null_Unbounded_String;
begin
N := Integer'Value(Argument(1));
for Num in 1..N loop
Append(Source => Buffer, New_Item => Hello);
end loop;
Put(Length(Buffer));
New_Line;
end Strcat;