procedure TForm1.StringGrid1Click(Sender: TObject); begin n:=StringGrid1.Col; k:=StringGrid1.Row; vvod(StringGrid1, n,k); r:=0; for i:=1 to s1 do for j:=1 to s2 do if StringGrid1.Cells[i-1,j-1]<>'?' then r:=r+1; Edit5.text:=IntToStr(r); if r=strToInt(Edit4.Text)-strToInt(Edit3.Text) then showmessage ('Вітаю, Ви виграли!!!'); end;