Hi to all. I'm not comfortable asking. But I hope for your help. I'm just starting to study C and faced a problem. I need that at the correctly entered data she passed me. I enter x = 3, y = 0. If I should skip because this is the correct data but it does not let further code. Maybe someone knows what the problem is. Thank you in advance
#include <stdio.h>
#include <math.h>
int main()
{
float x1, x2, x3, y1, y2, y3;
float P, s, ab,bc,b,a,c,ac,p,S;
printf("Введіть х1\n");
scanf("%f", &x1);
printf("Введіть у1\n");
scanf("%f", &y1);
if (((-3)<=y1<=0) && (y1<=(x1/2)) && (((x1*x1)+(y1*y1))<=9)){
printf("+");
}else{
return 0;
}
printf("Введіть x2\n");
scanf("%f", &x2);
printf("Введіть у2\n");
scanf("%f", &y2);
if ((-3<=y2<=0) && (y2<=x2/2) && ((x2*x2)+(y2*y2)<=9)){
}else{
return 0;
}
printf("Введіть x3\n");
scanf("%f", &x3);
printf("Введіть у3\n");
scanf("%f", &y3);
if ((-3<=y3<=0) && (y3<=x3/2) && ((x3*x3)+(y3*y3)<=9)){
}else{
return 0;
}
if ((x2-x1)*(y3-y2)==(x3-x2)*(y2-y1)==(x3-x1)*(y2-y1)==(x2-x1)*(y3-y1)){
printf("Лежать на одній прямій");
return 0;
}
ab=((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1));
a=sqrt(ab);
bc=((x3-x2)*(x3-x2))+((y3-y2)*(y3-y2));
b=sqrt(bc);
ac=((x3-x1)*(x3-x1))+((y3-y1)*(y3-y1));
c=sqrt(ac);
P=a+b+c;
p=P/2;
S=p*(p-a)*(p-b)*(p-c);
s=sqrt(S);
printf("Периметр трикутника-%.2f, Площа трикутника- %.2f",P,s);
return 0;
}