Triangle

in #ita2 months ago

using System;

public static class Triangle

{

   public static bool IsScalene(double a, double b, double c) => IsTriangle(a, b, c) && a != b && b != c && a != c;

private static bool IsTriangle(double a, double b, double c) => a + b > c && a + c > b && b + c > a;

public static bool IsIsosceles(double side1, double side2, double side3) 

{

           if((((side1==side2) && (side1==side3)&& (side1!=side3))|| ((side1==side3) && (side1==side3)&& (side2!=side3)) || ((side2==side3) && (side1==side2)&& (side1!=side3)) || ((side1==side2) && (side1==side3)&& (side2==side3))|| ((side1==side2) && (side1!=side3)&& (side2!=side3))|| ((side1!=side2) && (side1!=side3)&& (side2==side3)))&& (side1!=0) && (side2!=0)&& (side3!=0) && (side1+side2>=side3) && (side2+side3>=side1) && (side1+side3>=side2))

{

    return true;

    }

else return false;





}

public static bool IsEquilateral(double side1, double side2, double side3) 

{

    if(((side1==side2) && (side2==side3)&& (side1==side3))&& ((side1!=0) && (side2!=0)&& (side3!=0)) && (side1+side2>=side3) && (side2+side3>=side1) && (side1+side3>=side2))

 { 

    return true; 

 } 

else return false;

}

}