现在的位置: 首页 > 综合 > 正文

杭电ACM 2039 三角形

2013年10月25日 ⁄ 综合 ⁄ 共 258字 ⁄ 字号 评论关闭

http://acm.hdu.edu.cn/showproblem.php?pid=2039

这道题主要注意float和三角形的判定条件a+b>c&&b+c>a&&a+c>b,否则容易WR

#include <iostream>
using namespace std;
int main()
{
	int n;
	cin>>n;
	float a,b,c;
	while(n--){
		cin>>a>>b>>c;
		if(a+b>c&&b+c>a&&a+c>b) cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

抱歉!评论已关闭.