1 solutions

  • 0
    @ 2025-11-5 15:45:09

    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;
    }
    

    Pascal :

    var
      a,b,c:longint;
    begin
      readln(a,b,c);
      if (a+b>c)and(a+c>b)and(b+c>a) then
        if (a*a+b*b=c*c)or(a*a+c*c=b*b)or(b*b+c*c=a*a) then
          writeln('Yes!')
          else writeln('No!')
        else writeln('Error!');
    end.
    
    • 1

    Information

    ID
    17126
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By