procedure
TForm1
.
FormCreate(Sender: TObject);
begin
Form1
.
StringGrid1
.
Cells[
0
,
0
]:=
'X'
;
Form1
.
StringGrid1
.
Cells[
1
,
0
]:=
'Y'
;
Form1
.
StringGrid1
.
Cells[
2
,
0
]:=
'X и Y'
;
Form1
.
StringGrid1
.
Cells[
0
,
1
]:=
'1'
;
Form1
.
StringGrid1
.
Cells[
1
,
1
]:=
'1'
;
end
;
procedure
TForm1
.
Button1Click(Sender: TObject);
var
x, y, a:
boolean
;
xs, ys, astr:
string
;
i:
integer
;
begin
i:=
0
;
for
x:=
false
to
true
do
for
y:=
false
to
true
do
begin
if
x=
false
then
xs:=
'0'
else
xs:=
'1'
;
if
y=
false
then
ys:=
'0'
else
ys:=
'1'
;
a:= x
and
y;
if
a=
false
then
astr:=
'0'
else
astr:=
'1'
;
Form1
.
StringGrid1
.
cells[
0
,
1
]:=xs;
Form1
.
StringGrid1
.
cells[
1
,
1
]:=ys;
Form1
.
StringGrid1
.
cells[
2
,
1
]:=astr;
end
;
end
;
end
.