It seems everything is correct, but the error still goes. Thank you in advance. enter image description here

Here is the code itself:

uses crt; var Xa,Xb,Xc,Ya,Yb,Yc,x,y:integer; ab,bc,ac,s1,s2,p1,p2,ax,xc:real; begin read(Xa,Xb,Xc,Ya,Yb,Yc,x,y); if (x<=xc) and (y>=0) and (x>=xa) and (y<=yb) then begin ab:=sqrt(sqr(xb-xa)+sqr(yb-ya)); bc:=sqrt(sqr(xc-xb)+sqr(yc-yb)); ac:=sqrt(sqr(xc-xa)+sqr(yc-ya)); p1:=(ab+bc+ac)/2; s1:=sqrt(p1*(p1-ab)*(p1-bc)*(p1-ac)); ax:=sqrt(sqr(xb-xa)+sqr(yb-ya)); xc:=sqrt(sqr(xb-xa)+sqr(yb-ya)); p2:=(ax+xc+ac)/2; s2:=sqrt(p2*(p2-ax)*(p2-xc)*(p2-ac)); end else if s1<=s2 then write('Точка принадлежит выделенной области') else write('Точка не принадлежит выделенной области'); else write('Точка не принадлежит выделенной области'); end. 
  • “but the error still comes out” is in what language? You understand that if execution does not enter if , then s1 and s2 remain uncalculated, and if it does, else if will not be executed? - Igor

1 answer 1

Why so many difficulties? In the picture above, the area is explicitly set. The formula can be reduced:

 begin var x, y : Real; ReadLn(x, y); WriteLn('Точка ', Not((abs(x) <= 4) and (y >= 0) and (y <= 4) and (y + abs(x) <= 4)) ? 'не ' : '' , 'принадлежит выделенной области.'); end.