nyoj-659-判断三角形
2013-07-13 11:56
169 查看
#include<stdio.h> #include<string.h> #include<algorithm> #include<math.h> using namespace std; int main() { int n,a[3],i,j; while(scanf("%d",&n)!=EOF) { for(i=1;i<=n;i++) { for(j=0;j<3;j++) scanf("%d",&a[j]); sort(a,a+3); int num=0; if(a[0]+a[1]>a[2]) { num++; if(a[0]==a[1]||a[0]==a[2]||a[1]==a[2]) { num++; if(a[0]==a[1]&&a[1]==a[2]) num++; } } switch (num) { case 0: printf("Case #%d:\nNO\n",i); break; case 1: printf("Case #%d:\nYE\n",i); break; case 2: printf("Case #%d:\nYE YE\n",i); break; case 3: printf("Case #%d:\nYE YE YE\n",i); break; } } } return 0; }
相关文章推荐
- NYOJ 659 判断三角形【简单题】
- NYOJ 659 判断三角形
- nyoj-659-判断三角形(大坑)
- NYOJ659 判断三角形
- NYOJ659 判断三角形
- nyoj 487点数(向量积判断三角形内部的整点)
- nyoj判断三角形
- nyoj-659-推断三角形(大坑)
- NYOJ-判断三角形
- 6.判断三角形
- 判断输入的三个数据是否可以构成一个三角形
- 三角形的判断
- nyoj 三角形面积
- NYOJ 1099 Lan Xiang's Square(给出四点判断是否能构成正方形)
- 其他题目---判断一个点是否在三角形内部
- 模仿第三周任务,判断三角形
- C语言习题5.11--判断三角形
- 第十一周—判断三角形
- NYOJ - 三角形面积
- CSU 1272 1272: Karma(几何 判断点是否在三角形内)