Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2400 孙浚轩 判断三角形形状 C++ Accepted 1 MS 264 KB 573 2023-12-31 00:01:58

Tests(1/1):


Code:

#include<iostream> #include<cmath> using namespace std; double p(double x){ return pow(x,2); } int main(){ int t; cin>>t; int a[t],b[t],c[t]; for(int i=0;i<t;i++) cin>>a[i]>>b[i]>>c[i]; for(int i=0;i<t;i++){ if(a[i]==b[i]||a[i]==c[i]||b[i]==c[i]) cout<<"perfect"; else if(p(a[i])+p(b[i])==p(c[i])||p(a[i])+p(c[i])==p(b[i])||p(b[i])+p(c[i])==p(a[i])) cout<<"good"; else cout<<"just a triangle"; if(i!=t-1) cout<<endl; } return 0; }