lightoj1043(相似三角形面积自比等于对应边比的平方)
来源:互联网 发布:免费企业网管软件 编辑:程序博客网 时间:2024/05/02 02:43
Description
See the picture below.
You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.
Input
Input starts with an integer T (≤ 25), denoting the number of test cases.
Each case begins with four real numbers denoting AB, AC, BC and the ratio of ADE and BDEC(ADE / BDEC). You can safely assume that the given triangle is a valid triangle with positive area.
Output
For each case of input you have to print the case number and AD. Errors less than 10-6 will be ignored.
Sample Input
4
100 100 100 2
10 12 14 1
7 8 9 10
8.134 9.098 7.123 5.10
Sample Output
Case 1: 81.6496580
Case 2: 7.07106781
Case 3: 6.6742381247
Case 4: 7.437454786
AC代码:
#include<stdio.h>#include<math.h>int main(){int t,k=1;double a,b,c,d,ad;scanf("%d",&t);while(t--){scanf("%lf%lf%lf%lf",&a,&b,&c,&d);double f=sqrt(d/(d+1.0));ad=a*f;printf("Case %d: ",k++);printf("%.7lf\n",ad);}return 0;}
- lightoj1043(相似三角形面积自比等于对应边比的平方)
- 边之比的平方=面积之比
- 长度、面积、体积的相似比原理
- light oj 1043(数学 + 三角形面积与边之比)
- Tsinsen P3994(大等于n的最小完全平方数-比细心)
- 给定一个正整数n,找到比n小的完美平方数相加和等于n的最小数目。
- 总相似比过高的结果
- zoj 1439 Area Ratio 计算三角形内接圆面积和外接圆面积之比
- 逗比三角形 sbtg
- 由數組比較引出的“等于”問題
- 数据分词及相似度的比对
- 比对图像相似度的一种方法
- 文件相似度比对工具的设计与实现
- IMAGEJ中幾種自動閾值的比較
- (he)的平方等于she
- 比
- 比
- 三角形失真解决方法和纵横比的关系
- Python配置Houdini项目环境变量以及集成工具架
- 致在孤独的奋斗中迷茫了的人们
- 搭建spark cluster网络设置,ipv6关闭,ipv4设置,DNS设置
- Machine Learning week 11 quiz: Application: Photo OCR
- web调用本地方法,并实现打印功能(屏幕分辨率导致打印断断续续不清晰)
- lightoj1043(相似三角形面积自比等于对应边比的平方)
- Linux iptables常见防护攻击措施
- 关于MASTER=spark://SparkMaster:7077 ./spark-shell问题
- FPGA学习之流水灯的简单设计
- Windows7+opencv配置完成后用于测试的代码
- Java线程中run和start方法的区别
- 南大软院大神养成计划--day21
- HP LoadRunner 基础
- ftp vsftpd服务器安装(云虚拟机Centos 7.0)