题目链接:点击打开链接
简单的数学公式题,相似三角形面积比为边长比的平方,套公式即可。
// LightOJ 1043 Triangle Partitioning.cpp 0ms/500ms
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main(){
int t, cases = 0;
double a, b, c, d;
scanf("%d", &t);
while (t--) {
scanf("%lf%lf%lf%lf", &a, &b, &c, &d);
printf("Case %d: %f\n", ++cases,sqrt(a * a * d / (1.0 + d)));
}
return 0;
}