type Cl = class a:integer; constructor Create(b:integer); procedure P;end;constructor Cl.Create(b:integer);begin a := b;end;procedure Cl.P;begin if (a div 100 > 0) and (a > 0) then begin a := a - 1; writeln('new a = ', a); end;end;var Obj:Cl; a :integer;begin write('a = '); readln(a); Obj := Cl.Create(a); Obj.P; Readln; Obj.Destroy;end.
type Cl = class
a:integer;
constructor Create(b:integer);
procedure P;
end;
constructor Cl.Create(b:integer);
begin
a := b;
end;
procedure Cl.P;
begin
if (a div 100 > 0) and (a > 0) then
begin
a := a - 1;
writeln('new a = ', a);
end;
end;
var
Obj:Cl;
a :integer;
begin
write('a = ');
readln(a);
Obj := Cl.Create(a);
Obj.P;
Readln;
Obj.Destroy;
end.