水题,先用叉积求三角形面积
然后求三边上的点(由公约数上点)a
然后用pick定理S=a+b/2-1
就可以求出内部的点数了
var x,y,xx,yy,a1,a2,a3,x1,x2,x3,y1,y2,y3:longint;
s,ans:double; function gcd(a,b:longint):longint;
begin
if b= then exit(a)
else exit(gcd(b,a mod b));
end; begin
readln(x1,y1,x2,y2,x3,y3);
while not((x1=) and (x2=) and (x3=) and (y1=) and (y2=) and (y3=)) do
begin
x:=x2-x1;
y:=y2-y1;
xx:=x3-x1;
yy:=y3-y1;
s:=abs(x*yy-y*xx)/;
a1:=gcd(abs(x1-x2),abs(y1-y2));
a2:=gcd(abs(x1-x3),abs(y1-y3));
a3:=gcd(abs(x2-x3),abs(y2-y3));
ans:=s+-(a1+a2+a3)/;
writeln(ans::);
readln(x1,y1,x2,y2,x3,y3);
end;
end.