Решение задачи
{ Определить яв-ся ли n-угольник выпуклым Ввод состоит из n отрезков, n>3 и n<10 }
uses crt;
var m,n,k,i,j : integer;
ot:boolean;
x,y:array[1..10]
of integer;
z1,z2:real;
procedure haltproc;
begin
writeln('Неверные данные');
writeln('n >= 3');
readln;
halt;
end;
begin
clrscr;
write('n=');readln(n);
if n<3 then haltproc;
for i:=1 to n do
begin
write('x[',i,']=');
readln(x[i]);
write('y[',i,']=');
readln(y[i]);
end;
ot:=true;
for i:=1 to n do
begin
j:=i+1;
k:=j+1;
if k=n+1 then k:=1;
if i=n then j:=1;
m:=i-1;
if m=n-1 then k:=2;
if i=1 then m:=n;
z1:=(x[m]-x[i])*(y[j]-y[i])
-(y[m]-y[i])*(x[j]-x[i]);
z2:=(x[k]-x[i])*(y[j]-y[i])
-(y[k]-y[i])*(x[j]-x[i]);
if z1*z2<0 then ot:=false;
end;
if ot=true then
write('выпуклый')
else write('не выпуклый');
readln;
end.

