var
Angl: array [1..10] of string =
('I', 'love', 'my', 'dog', 'cat', 'go', 'school', 'to',
'goes', 'loves');
Slov: array [1..10] of string =
('Ja', 'ľúbi', 'moj', 'pes', 'mačka', 'ide', 'škola', 'do',
'ide', 'ľúbi');
Veta, Slovo, PSlovo, Preklad: string;
I: Integer;
begin
Veta := Edit1.Text + ' ';
Memo1.Lines.Append(Veta);
Preklad := '';
while Veta > '' do
begin
Slovo := Copy(Veta, 1, Pos(' ', Veta) - 1);
Delete(Veta, 1, Pos(' ', Veta));
PSlovo := Slovo;
for I := 1 to 10 do
if Slovo = Angl[I] then
PSlovo := Slov[I];
Preklad := Preklad + PSlovo + ' ';
end;
Memo1.Lines.Append('>' + Preklad);
end;
------
var
Obraty, Ucet: array [1..31] of Integer;
I, Stav: Integer;
R: string;
begin
Randomize;
for I := 1 to 31 do
if Random(5) = 0 then
Obraty[I] := 5 * Random(10)
else
Obraty[I] := - Random(10);
Memo1.Lines.Append('*** obraty ***');
R := '';
for I := 1 to 31 do
R := R + IntToStr(Obraty[I]) + ', ';
Memo1.Lines.Append(R);
Stav := 20;
for I := 1 to 31 do
begin
Ucet[I] := Stav + Obraty[I];
Stav := Ucet[I];
end;
Memo1.Lines.Append('*** účet ***');
R := '';
for I := 1 to 31 do
R := R + IntToStr(Ucet[I]) + ', ';
Memo1.Lines.Append(R);
end;