By side, a triangle has 3 types, equilateral if it has three equal sides, isosceles if it has two
- برمجة جافا
- 2022-04-20
- softwareEngineer
الأجوبة
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
System.out.println("Enter 3 sides of a Triangle:");
Scanner input =new Scanner(System.in);
int l, m, n;
l= input.nextInt();
m= input.nextInt();
n= input.nextInt();
if(l )
{
System.out.print("Triangle type: ");
if (l==m==n)
System.out.println("Equilateral");
else if(l==m || m==n || l==n)
System.out.println("isosceles");
else if(l!=m && m!=n && l!=n)
System.out.println("scalene");
}
else{
System.out.println("not a Triangle");
}
}
}القوائم الدراسية التي ينتمي لها السؤال