P10520 [XJTUPC2024] 榕树之心 tj
_colin1112_ · · 题解
- 考察基本编程运算与语法。
思路
首先输入两个数
依次输出算出的
Code
#include <bits/stdc++.h>
#define endl '\n'
#define ll long long
using namespace std;
const int E = 1e6 + 5;
ll x, y;
int main()
{
cin >> x >> y;
double x_1 = x * 1.0 / 2 + y * 1.0 / 2, y_1 = sqrt(3) * 1.0 / 2 * 1.0 * x - sqrt(3) * 1.0 / 2 * 1.0 * y;
cout << fixed << setprecision(6) << x_1 << " " << y_1;
return 0;
}