type Cl = class
a:integer;
constructor Create(b:integer);
procedure SetVal(b:integer);
function GetVal:integer;
procedure Sq;
end;
constructor Cl.Create(b:integer);
begin
a := b;
end;
procedure Cl.SetVal(b:integer);
begin
a := b;
end;
function Cl.GetVal:integer;
begin
GetVal := a;
end;
procedure Cl.Sq;
begin
if a < 0 then
writeln('a ^ 2 = ', a * a)
else
writeln('Error');
end;
var
Obj:Cl;
a :integer;
begin
write('a = ');
readln(a);
Obj := Cl.Create(a);
Obj.Sq;
Readln;
Obj.Destroy;
end.