- 考察基本编程运算与语法。
思路
首先输入两个数 ,然后根据题面所给公式计算:
依次输出算出的 与 即可。
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;
}