LightOJ 1043 Triangle Partitioning

来源:互联网 发布:中世纪2原版优化9兵种 编辑:程序博客网 时间:2024/06/04 15:53

题目链接 http://lightoj.com/volume_showproblem.php?problem=1043

相似三角形,水题

#include <stdio.h>#include <math.h>int main (){int T;scanf("%d",&T);for (int cas=1;cas<=T;cas++){double AB,ratio,ans;scanf("%lf%*lf%*lf%lf",&AB,&ratio);ans=sqrt(1.0/(1.0/ratio+1))*AB;printf("Case %d: %.9lf\n",cas,ans);}return 0;}


原创粉丝点击