Higher Math

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2219    Accepted Submission(s): 1219

Problem Description
You are building a house. You’d prefer if all the walls have a precise right angle relative to the ground, but you have no device to measure angles. A friend says he has a great idea how you could ensure that all walls are upright: All you need to do is step away a few feet from the wall, measure how far away you are from the wall, measure the height of the wall, and the distance from the upper edge of the wall to where you stand. You friend tells you to do these measurements for all walls, then he’ll tell you how to proceed. Sadly, just as you are done, a timber falls on your friend, and an ambulance brings him to the hospital. This is too bad, because now you have to figure out what to do with your measurements yourself.

Given the three sides of a triangle, determine if the triangle is a right triangle, i.e. if one of the triangle’s angles is 90 degrees.

 
Input
The inputs start with a line containing a single integer n. Each of the n following lines contains one test case. Each test case consists of three integers 1 <= a, b, c <= 40000 separated by a space. The three integers are the lengths of the sides of a triangle.
 
Output
The output for every scenario begins with a line containing “Scenario #i:”, where i is the number of the scenario counting from 1. After that, output a single line containing either the string “yes” or the string “no”, depending on if the triangle in this test case has a right angle. Terminate each test case with an empty line.
 
Sample Input
2
36 77 85
40 55 69
 
Sample Output
Scenario #1:
yes
 
Scenario #2:
no
 
Source
 
Recommend
lcy   |   We have carefully selected several similar problems for you:  2391 2389 2390 2386 2388 

 
  计算几何,水题
  题意:给你三个数,作为三角形的三边,判断这个数是不是直角三角形。
  代码:
 #include <iostream>

 using namespace std;

 int main()
{
int i,a,b,c,T;
cin>>T;
for(i=;i<=T;i++){
cin>>a>>b>>c;
if(a*a+b*b==c*c || b*b+c*c==a*a || a*a+c*c==b*b)
cout<<"Scenario #"<<i<<':'<<endl<<"yes"<<endl;
else
cout<<"Scenario #"<<i<<':'<<endl<<"no"<<endl;
cout<<endl;
}
return ;
}

Freecode : www.cnblogs.com/yym2013

最新文章

  1. ASP.NET Core &quot;完整发布,自带运行时&quot; 到jexus
  2. Android 各层调用的方式
  3. Linux学期总结
  4. 解析某些特殊格式XML文件时,获取不到根节点问题
  5. 《OD大数据实战》驴妈妈旅游网大型离线数据电商分析平台
  6. Android:查看应用创建的数据库
  7. Asp.net正则获取html内容
  8. linux之vim编辑器
  9. use - D_SCL_SECURE_NO_WARNINGS
  10. Codeforces Round#2
  11. Nginx+rtmp+ffmpeg 搭建推流服务器
  12. 9102 IT人保持记忆力及健康的方法
  13. iOS -- Effective Objective-C 阅读笔记 (8)
  14. 关于synchronized的同步操作
  15. http://linux-mtd.infradead.org/doc/nand.html nand
  16. AM软件中reconfig的方法
  17. Mac 下配置Nginx安装环境配置详细说明
  18. 聊聊MySQL的子查询
  19. Ajax引擎:ajax请求步骤详细代码
  20. ElasticSearch 2 (32) - 信息聚合系列之范围限定

热门文章

  1. QT国际化 一 (lupdate/linguits/lrelease)
  2. centos 本地dns配置
  3. Git索引
  4. Oracle 数据操作
  5. DevExpress使用教程合集
  6. Appium根据xpath获取控件
  7. opencv-3.x.0-x86-mingw32-staticlib-gcc5.3.0-20160712.7z
  8. ABAP 销售范围
  9. asp.net中获取当前url的方法
  10. Divide and conquer:Moo University - Financial Aid(POJ 2010)