HDU2393 Higher Math【几何】【水题】
来源:互联网 发布:宁波网络继续教育 编辑:程序博客网 时间:2024/05/24 16:16
题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=2393
题目大意:
给你三角形的三条边长,问:是否能构成直角三角形。
思路:
三角形勾股定理。最大边不超过40000,运算中间数最大是3.2*10^9,int的上界是2.2*10^10,
所以不用担心溢出。
AC代码:
#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>#include<cmath>using namespace std;int main(){ int T,a,b,c,kase = 0; cin >> T; while(T--) { cin >> a >> b >> c; cout << "Scenario #" << ++kase << ':' << endl; if(a*a+b*b==c*c || a*a+c*c==b*b || b*b+c*c==a*a) cout << "yes" << endl; else cout << "no" << endl; cout << endl; } return 0;}
0 0
- HDU2393 Higher Math【几何】【水题】
- hdu2393 Higher Math--判断是否是直角三角形
- ACM-水题 Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- Higher Math
- hdu 2393 Higher Math
- hd 2393 Higher Math
- HDU 2393 Higher Math
- HDU - 2393 Higher Math
- hdu 2393 Higher Math
- HDU1.2.7 Higher Math
- HDU 2393 Higher Math
- HDU 2393 Higher Math
- 第五周阅读程序2:数组操作对象
- 状态值速查表
- 安装ECC EHP6 on Windows Server 2008
- git stash 学习
- 第五周项目三——用多文件组织多个类的程序
- HDU2393 Higher Math【几何】【水题】
- Contest1376 - "师创杯"烟台大学第二届ACM程序设计精英赛复现 A--A Repeating Characters
- android5.0编译问题:No rule to make target 'external/chromium_org/third_party/angle/.git/index',
- 面试题之_00(旋转字符串)
- 阅读程序
- 用多文件组织多个类的程序
- 第五周 项目四-静态成员应用
- 第五周项目一 体验常成员函数
- 快速排序(QuickSort)