题解:P10520 [XJTUPC2024] 榕树之心

· · 题解

照着给出的公式写即可。

#include<cstdio>
#include<cmath>
int a[200000];
int main(){
    double x_,y_;
    int x,y;
    scanf("%d %d",&x,&y);
    x_=x*0.5+y*0.5;
    y_=sqrt(3)/2*x-sqrt(3)/2*y;
    printf("%.6lf %.6lf",x_,y_);
    return 0;
}