Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Look-and-say-sequence/Ada/look-and-say-sequence-1.ada
Normal file
13
Task/Look-and-say-sequence/Ada/look-and-say-sequence-1.ada
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
with Ada.Text_IO, Ada.Strings.Fixed;
|
||||
use Ada.Text_IO, Ada.Strings, Ada.Strings.Fixed;
|
||||
|
||||
function "+" (S : String) return String is
|
||||
Item : constant Character := S (S'First);
|
||||
begin
|
||||
for Index in S'First + 1..S'Last loop
|
||||
if Item /= S (Index) then
|
||||
return Trim (Integer'Image (Index - S'First), Both) & Item & (+(S (Index..S'Last)));
|
||||
end if;
|
||||
end loop;
|
||||
return Trim (Integer'Image (S'Length), Both) & Item;
|
||||
end "+";
|
||||
10
Task/Look-and-say-sequence/Ada/look-and-say-sequence-2.ada
Normal file
10
Task/Look-and-say-sequence/Ada/look-and-say-sequence-2.ada
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
Put_Line (+"1");
|
||||
Put_Line (+(+"1"));
|
||||
Put_Line (+(+(+"1")));
|
||||
Put_Line (+(+(+(+"1"))));
|
||||
Put_Line (+(+(+(+(+"1")))));
|
||||
Put_Line (+(+(+(+(+(+"1"))))));
|
||||
Put_Line (+(+(+(+(+(+(+"1")))))));
|
||||
Put_Line (+(+(+(+(+(+(+(+"1"))))))));
|
||||
Put_Line (+(+(+(+(+(+(+(+(+"1")))))))));
|
||||
Put_Line (+(+(+(+(+(+(+(+(+(+"1"))))))))));
|
||||
Loading…
Add table
Add a link
Reference in a new issue