text
stringlengths
0
234
Function Definition: procedure Upg1 is
Function Body: procedure Print(A, B: in Integer) is
Spaces: Integer;
begin
if A < B then
Spaces := (B - A) * 4;
for I in 1..Spaces loop
Put(' ');
end loop;
end if;
for X in 1..A loop
Put(B,1); Put(' ');
if A = X then
Put("= "); Put(A * B, 1);
else
Put("+ ");
end if;
end loop;
New_Line;
Function Definition: procedure Upg4 is
Function Body: type Ints is
array(1..10) of Integer;
type Arrs is
array(1..20) of Ints;
procedure Extract(Data: out Arrs) is
File : File_Type;
begin
Open(File, In_File, "NUMMER.TXT");
for X in Data'Range loop
for I in Ints'Range loop
Get(File, Data(X)(I));
end loop;
end loop;
Close(File);
Function Definition: procedure Upg3 is
Function Body: function Count
return Integer is
S : String(1..3);
C : Character;
A, B : Integer;
begin
Get(S);
Get(A);
Get(C); Get(C);
Get(B);
return (B - A + 1);
Function Definition: procedure Upg2 is
Function Body: function Generate
return Integer is
subtype Nums is Integer range 0..99;
package RN is
new Ada.Numerics.Discrete_Random(Nums);
Gen : RN.Generator;
begin
RN.Reset(Gen);
return RN.Random(Gen);
Function Definition: procedure Upg3 is
Function Body: Syl_Arr : constant array(1..100) of String(1..4) := (
"ach ", "tun ", "ep ", "tur ", "tash",
"ine ", "me ", "arr ", "et ", "ze ",
"cre ", "uss ", "dar ", "ien ", "her ",
"cant", "jol ", "nar ", "kam ", "dorn",
"li ", "sis ", "maal", "uk ", "mec ",
"at ", "ol ", "mi ", "ra ", "ge ",
"mor ", "dai ", "nest", "phar", "rag ",
"ret ", "ill ", "on ", "dru ", "ah ",
"quin", "sha ", "loq ", "tre ", "lak ",
"sum ", "eri ", "an ", "tsi ", "win ",
"ter ", "arch", "on ", "ren ", "i ",
"pri ", "tau ", "cu ", "ry ", "ven ",
"us ", "mar ", "jup ", "it ", "er ",
"sat ", "uh ", "un ", "plu ", "gol ",
"kar ", "lam ", "wel ", "pik ", "chu ",
"cha ", "man ", "der ", "za ", "bla ",
"sto ", "id ", "sau ", "tan ", "sin ",
"cos ", "chut", "stri", "stra", "stru",
"skro", "skre", "cet ", "nya ", "nyu ",
"ple ", "pra ", "ble ", "glu ", "geo ");
Num, I: Integer;
Index: Integer := 1;
Ut: String(1..200);
Stav: String(1..4);
Ver: Boolean := True;
begin
Put("Mata in antal stavelser: "); Get(Num);
Put("Mata in stavelseindex: ");
for X in 1..Num loop
Get(I);
if I < 0 then
Stav := Syl_Arr(-I);
Ut(Index) := '-';
Ver := True;