joj 1817: Triangle 三角的判定
joj1817: Triangle 三角形的判定?1817: TriangleResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE5s81
joj 1817: Triangle 三角形的判定
?1817: Triangle
ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE
5s8192K2409685Standard#include <iostream>using namespace std;int main(void){int a,b,c,r,count=0;while(cin>>a>>b>>c){if(a<b){r = a;a = b;b = r;}if(a<c){r = a;a = c;c = r;}if(b<c){//此处没有必要r = b;b = c;c = r;}if(a>=b+c) //偶然的避开了 1 2 3时候 a*a > b* b + c*ccout<<"Case "<<++count<<": is not a valid triangle."<<endl;else if(a*a==b*b+c*c)cout<<"Case "<<++count<<": is a right triangle."<<endl;else if(a*a>b*b+c*c)cout<<"Case "<<++count<<": is a blunt triangle."<<endl;else if(a*a<b*b+c*c)cout<<"Case "<<++count<<": is a sharp triangle."<<endl;}return 0;}?
搞不明白
1 楼 RootJ 2012-01-26 输出时候没有写:号。。。 2 楼 jackchen0227 2012-03-30 汗,
谢谢啊