博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 2393:Higher Math(计算几何,水题)
阅读量:6365 次
发布时间:2019-06-23

本文共 2171 字,大约阅读时间需要 7 分钟。

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:            

 
  计算几何,水题
  题意:给你三个数,作为三角形的三边,判断这个数是不是直角三角形。
  代码:
1 #include 
2 3 using namespace std; 4 5 int main() 6 { 7 int i,a,b,c,T; 8 cin>>T; 9 for(i=1;i<=T;i++){10 cin>>a>>b>>c;11 if(a*a+b*b==c*c || b*b+c*c==a*a || a*a+c*c==b*b)12 cout<<"Scenario #"<
<<':'<
<<"yes"<

 

Freecode :

转载地址:http://hsama.baihongyu.com/

你可能感兴趣的文章
Unsupported major.minor version 52.0
查看>>
面对对象之差异化的网络数据交互方式--单机游戏开发之无缝切换到C/S模式
查看>>
优酷网架构学习笔记
查看>>
把HDFS里的json数据转换成csv格式
查看>>
浅谈 Swift 中的属性(Property)
查看>>
WEEX-EROS | 集成并使用 bindingx
查看>>
Spring5源码解析-Spring中的异步和计划任务
查看>>
广州牵引力来告诉你学编程先学什么语言好?
查看>>
广州牵引力总结初学者怎样学好UI设计?
查看>>
使用Metrics方法级远程监控Java程序
查看>>
Spring核心系列之Bean的生命周期
查看>>
VasSonic源码之并行加载
查看>>
小程序 LRU 存储设计
查看>>
Android 多线程之阻塞队列
查看>>
[译] 关于 Angular 依赖注入你需要知道的
查看>>
Haskell 在 macOS 下的环境搭建
查看>>
适配mpvue平台的的微信小程序日历组件mpvue-calendar
查看>>
【Linux学习】 Redis常用的一些指令
查看>>
Spring Cloud 中使用Feign解决参数注解无法继承的问题
查看>>
数据迁移方案 + Elasticsearch在综合搜索列表实现
查看>>