HDU 2393 Higher Math
来源:互联网 发布:js实现动态时钟 编辑:程序博客网 时间:2024/04/30 22:53
Higher Math
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5128 Accepted Submission(s): 1655Problem 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
血的教训...
#include<stdio.h>__int64 a,b,c,temp; //64位整数的定义int main(){ int i,n,flag; scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%I64d%I64d%I64d",&a,&b,&c); //64位整数的输入格式 flag=0; if(a>b) { temp=a; a=b; b=temp; } if(b>c) { temp=c; c=b; b=temp; } if(a*a+b*b==c*c) { flag=1; } printf("Scenario #%d:\n",i); if(flag) { printf("yes\n"); } else { printf("no\n"); } printf("\n"); } return 0;}判断 是否为直角三角形前要保证 C 为最大边 - -~!
0 0
- 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 2393(Higher Math)
- hdu 2393 Higher Math
- HDU Higher Math
- hd 2393 Higher Math
- HDU 2393 Higher Math 计算是否是直角
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- HDU2734:Quicksum
- android 下 对3G 模块进行AT 命令调试
- 谈下自己,我比较精通J2SE,熟悉J2SE里的Servlet等
- 20个最热门的IT技术职位及薪资
- 设计模式-组合模式
- HDU 2393 Higher Math
- QT Creator 创建带QWebView的项目时错误:无法解析的外部符号~QWebView::~
- 自己做的一个投票管理的系统,感觉还是挺好的哦
- C++ 术语
- Python学习笔记——Python开发中的控制语句
- 一个php的项目,挺简单的,我只说下内容吧
- 可扩展的网络架构和分布式系统 --Scalable Web Architecture and Distributed Systems
- chrome运行android程序
- 再见了,ACM