Mistři v programování na #hovnokod

C/C++ #4644

read it

int main(){
	const double degToRad = 3.14159265358979323846 / 180.00;
	Vertex A,B,C;
	A = init(A);
	B = init(B);
	C = init(C);
	scanf("%lf %lf %lf %lf %lf %lf", &A.x, &A.y, &A.angle, &B.x, &B.y, &B.angle);
	if(inputIsInvalid(A,B)){
		printf("-1\n");
		return 0;
	}
	C.angle = 180.00 - A.angle - B.angle;
	C.side = sqrt(pow(B.x - A.x, 2)+pow(B.y - A.y,2));
	B.side = (sin(B.angle * degToRad) * C.side)/(sin(C.angle * degToRad));
	A.side = (sin(A.angle * degToRad) * C.side)/(sin(C.angle * degToRad));
	double height = B.side * sin(A.angle * degToRad);
	double* x = (double*) malloc(2*sizeof(double));
	double* y = (double*) malloc(2*sizeof(double));
	calculateRootX(A,B,C,x);
	calculateRootY(A,B,C,x,y);
	if(*y > *(y+1)){
		C.x = *x;
		C.y = *y;
	}else{
		C.x = *(x+1);
		C.y = *(y+1);
	}
	printf("%.2lf %.2lf %.2lf\n", height, C.x, C.y);
	return 0;
}

Anonymous,