LightOj 1053 Higher Math




#include <bits/stdc++.h>
using namespace std;
int main()
{
    long long int t,a,b,c,m,n,i,j,p,q,r;
    vector<long long int>x;
    //freopen("1053.txt","r",stdin);
    //freopen("1053out.txt","w",stdout);
    cin>>t;
    for(i=1;i<=t;i++)
    {
        cin>>a>>b>>c;
        x.clear();
        x.push_back(a);
        x.push_back(b);
        x.push_back(c);
        sort(x.begin(),x.end());
        p=x[0]*x[0];
        q=x[1]*x[1];
        r=x[2]*x[2];
        if(r==p+q)
        {
            printf("Case %lld: yes\n",i);
        }
        else
        {
            printf("Case %lld: no\n",i);
        }


    }
    return 0;
}

Download Coding Interview Book and Get More Tutorials for Coding and Interview Solution: Click Here

Download System Design Interview Book and Get More Tutorials and Interview Solution: Click Here

Do you need more Guidance or Help? Then Book 1:1 Quick Call with Me: Click Here

Share on Google Plus

About Ashadullah Shawon

I am Ashadullah Shawon. I am a Software Engineer. I studied Computer Science and Engineering (CSE) at RUET. I Like To Share Knowledge. Learn More: Click Here
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment