#18428: d980 C++


anniechang2005 (啵的四葉草)

學校 : 臺北市私立延平高級中學
編號 : 83291
來源 : [203.72.178.252]
最後登入時間 :
2020-07-01 17:07:45
d980. 11479 - Is this the easiest problem? -- UVa11479 | From: [203.72.178.252] | 發表日期 : 2019-07-12 13:44

#include <iostream>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char** argv)
{
long long int t,a,b,c;
while(cin>>t)
{
for(int i=1; i<=t; i++)
{
a=0;b=0;c=0;
cin>>a>>b>>c;

if(a<=0 || b<=0 || c<=0 ) //side won't be 0 or -
{
// Case 1: Invalid
cout<<"Case "<<i<<": Invalid"<<endl;
}else if((a+b>c ) &&( a-b<c) )//triangle
{
if((a==b) && (b==c)) //正三角形
{
cout<<"Case "<<i<<": Equilateral"<<endl;

}else if((a==b) && (b!=c)) //等腰
{
cout<<"Case "<<i<<": Isosceles"<<endl;
} else
{
cout<<"Case "<<i<<": Scalene"<<endl;
}


}else
{
cout<<"Case "<<i<<": Invalid"<<endl;
}






}


}
//return 0;
}

 
ZeroJudge Forum