uses animals;
var lud, diszno: Tanimal;
Procedure Attack(A, B: Tanimal; NumA, NumB: Word);
begin
If NumA*A.Strength>NumB*B.Strength then write(A.Caption)
else if NumA*A.Strength<NumB*B.Strength then write(B.Caption)
else write('Nobody');
writeln(' Won');
end;
begin
Lud.Caption:='Lúd';
Lud.Strength:=10;
Diszno.Caption:='Disznó';
Diszno.Strength:=540;
Attack(Lud, Diszno, 1, 1 );
Attack(Lud, Diszno, 20, 1 );
Attack(Lud, Doszno, 60, 1 );
end.
F9 (Run)
Result:
Disznó Won.
Disznó Won.
Lúd Won.
ez nagggggggggggggggypn kemény xD