Замените цикл repeat-until на другой
var x1,x2,y1,x3,x4,y2,s:real;
begin
clrscr;
repeat
writeln('Введите абциссы вертикальных сторон первого прямоугольника x2>x1>=0');
readln(x1,x2);
until(x1>=0)and(x2>x1);
repeat
write('Ордината верхней стороны y1>0 y1=');
readln(y1);
until y1>0;
repeat
writeln('Введите абциссы вертикальных сторон второго прямоугольника x4>xx>=0');
readln(x3,x4);
until(x3>=0)and(x4>x3);
repeat
write('Ордината верхней стороны y2>0 y2=');
readln(y2);
until y2>0;
if (x3>=x2)or(x4<=x1) then write('Прямоугольники не пересекаются!')
else
begin
if y1>=y2 then
begin
if(x3>=x1)and(x4<=x2)then s:=(x4-x3)*y2 else
if(x3>=x1)and(x4>=x2)then s:=(x2-x3)*y2 else
if(x3<=x1)and(x4>=x2)then s:=(x2-x1)*y2 else
if(x3<=x1)and(x4<=x2)then s:=(x4-x1)*y2
end
else
begin
if(x3>=x1)and(x4<=x2)then s:=(x4-x3)*y1 else
if(x3>=x1)and(x4>=x2)then s:=(x2-x3)*y1 else
if(x3<=x1)and(x4>=x2)then s:=(x2-x1)*y1 else
if(x3<=x1)and(x4<=x2)then s:=(x4-x1)*y1
end;
write('Прямоугольники пересекаются, площадь пересечения=',s:0:2);
end;
readln
end.
int main(void) { int left, right, num = 5; time_t t;
scanf ("%d %d", &left, &right);
if(left >= right) { fprintf(stderr, "min_num is greater or equal than max_num!\n"); }
printf ("left = %d right = %d \n", left, right);
/* Intializes random number generator */ srand((unsigned) time(&t));
/* Print num random numbers from left to right */ while (num > 0) { printf ( "%d ", left + (rand() % (right + 1 - left)) ); num--; }
return 0;}
int main(void) { int left, right, num = 5; time_t t;
scanf ("%d %d", &left, &right);
if(left >= right) { fprintf(stderr, "min_num is greater or equal than max_num!\n"); }
printf ("left = %d right = %d \n", left, right);
/* Intializes random number generator */ srand((unsigned) time(&t));
/* Print num random numbers from left to right */ while (num > 0) { printf ( "%d ", left + (rand() % (right + 1 - left)) ); num--; }
return 0;}