hdu 2393
来源:互联网 发布:淘宝信誉评级在哪看 编辑:程序博客网 时间:2024/06/07 14:57
Higher Math
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1664 Accepted Submission(s): 897
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.
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
236 77 8540 55 69
Sample Output
Scenario #1:yesScenario #2:no
Source
HDU 2008-10 Public Contest
Recommend
lcy
#include <stdio.h>int main(){int n, a, b, c, i = 1;scanf("%d", &n);while (n--){scanf("%d%d%d", &a, &b, &c);printf("Scenario #%d:\n", i++);if(a*a == b*b + c*c || b*b == a*a + c*c || c*c == a*a + b*b)printf("yes\n\n");elseprintf("no\n\n");}return 0;}
- hdu 2393
- hdu 2393
- hdu 2393
- hdu 2393
- hdu 2393 Higher Math
- HDU 2393 Higher Math
- HDU - 2393 Higher Math
- hdu 2393 Higher Math
- HDU 2393 Higher Math
- HDU 2393 Higher Math
- HDU 2393 Higher Math
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- FTP文件操作之创建目录
- 一篇很全面的freemarker教程
- 香港公司章程中英文样本
- HttpURLConnection用法详解
- android2.3.4增加gsensor
- hdu 2393
- C语言中异常处理的两个函数
- 北美+德国18名校的数据挖掘、数据分析、人工智能及机器学习课程资源汇总
- bs_t结构及其相关函数的定义
- 颜色直方图, HSV直方图, histogram bins
- Android实现半透明的popupwindow
- ExtJs之Ext.data.Store
- VS2010对opencv 2.4.4 的配置、使用和相关错误
- Aix系统命令积累