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
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath> using namespace std; int main()
{
int z,t = ;
cin>>z;
while(z--)
{
printf("Scenario #%d:\n",++t);
int a,b,c;
cin>>a>>b>>c;
if(a>b) swap(a,b);
if(b>c) swap(b,c);
if(a*a+b*b == c*c) cout<<"yes"<<endl<<endl;
else cout<<"no"<<endl<<endl;
}
return ;
}

最新文章

  1. androidstdio偶遇一
  2. AugularJS特性
  3. python的高级特性3:神奇的__call__与返回函数
  4. 获取行间样式与在js中设置样式
  5. linux应用于发展(下)
  6. Java-螺旋方阵
  7. 算法库:Matlab与C++混合编程
  8. 学习XML总结
  9. B - 一行盒子
  10. PCB板可靠性测试方法择要
  11. 关于HTML的使用。
  12. 在C++中打印出变量的方法
  13. SAP自带的创建报表工具
  14. shell 查找与替换
  15. JS基础-第5天
  16. Browser Page Parsing Details
  17. 【.NET 深呼吸】.net core 中的轻量级 Composition
  18. Subverion仓库迁移知识点整理
  19. Vue:(三)路由
  20. HTTP协议请求方式: 中GET、POST和HEAD的介绍_孤帆一叶

热门文章

  1. Cocoapods依赖管理
  2. (转) Friendship and inheritance
  3. jxl读和取Excel文件
  4. postgresql数据库导入导出
  5. HC-MAC: A Hardware-Constrained Cognitive MAC for Efficient Spectrum Management
  6. 常用两种数据交换格式之XML和JSON的比较
  7. HtmlAgilityPack - 简介
  8. .net 反编译利器 dnspy
  9. android 控件的移动
  10. 百度地图LV1.5实践项目开发工具类bmap.util.jsV1.3