Hubei Province Programming Competition A. Srdce and Triangle


answer:
Draw auxiliary lines to construct an equilateral triangle, and then you can prove that triangle 1 and triangle 2 in the figure are congruent (edge, corner, edge, I didn't expect that in junior high school mathematics)

Obviously, the orange triangle is the triangle we require, so an angle can be calculated as minus 60°, and the same is true for the other two angles;
Attach the ac code:
#include<stdio.h>
#include<algorithm>
using namespace std;
intmain()
{
	double s[3];
	double a,b,c;
	while(scanf("%lf%lf%lf",&a,&b,&c)!=EOF)
    {
        s[0]=a-60;
	s[1]=b-60;
	s[2]=c-60;
	sort(s,s+3);
	printf("%lf %lf %lf\n",s[0],s[1],s[2]);
        
    }
    
    
	
	return 0;
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690681&siteId=291194637