杭电2039三角形
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2039
这道题提交了五次才AC,可见我的数学功底太差啦!
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int m; cin>>m; while(m--) { double a,b,c; cin>>a>>b>>c; if(a+b>c&&a+c>b&&b+c>a) cout<<"YES"<<endl; else cout<<"NO"<<endl; } system("PAUSE"); return EXIT_SUCCESS; }
两边之和大于第三边,两边之差小于第三边!无语····························~~~~~~~~~~~~~~