博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
HDU3188 Just A Triangle【水题】
阅读量:6862 次
发布时间:2019-06-26

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

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2862    Accepted Submission(s): 2028
Problem Description
  This is an easy problem, just for you to warm up.
  Give you three edges of a triangle. Can you tell me which kind of triangle it stands for?
If it’s a right triangle(直角三角形), please output “good”. If it’s a isosceles triangle(等腰三角形), please output “perfect”. Otherwise, please output “just a triangle”. You may suppose the input is legal.
Input
The first line contains an integer t means the number of test cases.
The each case contains three integers a, b, c in a line which stands for the length of the three edges.
(0 <a, b, c < 300).
Output
For each case, output the answer in one line.
Sample Input
 
4 3 4 5 2 2 3 1 4 4 4 6 3
Sample Output
 
good perfect perfect just a triangle
Source

问题链接:。

问题简述参见上文。

问题分析:(略)

程序说明:(略)

题记:(略)

AC的C++语言程序如下:

/* HDU3188 Just A Triangle */#include 
using namespace std;int main(){ int t, a, b, c; cin >> t; while(t--) { cin >> a >> b >> c; if(a == b || b == c || a == c) cout << "perfect" << endl; else if(a * a + b * b == c * c || b * b + c * c == a * a || a * a + c * c == b * b) cout << "good" << endl; else cout << "just a triangle" << endl; } return 0;}

转载于:https://www.cnblogs.com/tigerisland/p/7563614.html

你可能感兴趣的文章
zabbix_get 命令介绍
查看>>
jQuery属性操作之类样式操作
查看>>
JavaScript跨域总结与解决办法
查看>>
pipeline的存储代码
查看>>
随机生成验证码信息
查看>>
[codevs1036]商务旅行<LCA:tarjan&倍增>
查看>>
socket
查看>>
Linux指令
查看>>
技术人员的发展之路
查看>>
简单易懂,原码,补码,反码
查看>>
maven项目打包额外lib目录
查看>>
关于经纬度的开发日志
查看>>
JQuery合并table单元格--有限制(table格式需要注意)
查看>>
Moqui学习之代码分析mantle priceServices.xml
查看>>
[转]Browserify —— 利用Node.js实现JS模块化加载
查看>>
wxPython:进度条Gauge介绍
查看>>
js解析器的执行原理
查看>>
sass部分知识小结
查看>>
LCS 模板+规定长度的上升子序列个数(数值不同为不同)
查看>>
lua表排序
查看>>