游客 Signup | Login
中文 | En

2842 - 判断直角三角形

输入三角形的三边,判断它是否是直角三角形,是输出Yes,不是输出No,连三角形都不是,输出Error

Input

一行,输入3个整数

Output

Yes! 或者 No!或者 Error! (注意大小写,标点前无空格)

Examples

Input

3 4 5

Output

Yes!

Solution C++

#include<bits/stdc++.h>
using namespace std;
long long a[10];
int main()
{
	cin>>a[1]>>a[2]>>a[3];
    sort(a+1,a+4);
    if(a[1]+a[2]>a[3]&&a[1]+a[3]>a[2]&&a[2]+a[3]>a[1])
    {
    	if(a[3]*a[3]==a[1]*a[1]+a[2]*a[2])
    	    cout<<"Yes!";
    	else
    	    cout<<"No!";
    }
    else
        cout<<"Error!";
	
	return 0;
}
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题