【发布时间】:2021-07-09 03:36:54
【问题描述】:
System.out.println(" Enter the three sides of Triangle ");
Scanner s = new Scanner (System.in);
System.out.print(" a = " );
double a = s.nextDouble();
System.out.print(" b = " );
double b = s.nextDouble();
System.out.print(" c = " );
double c = s.nextDouble();
if ( a+b>c && b+c>a && c+a>b && a!=0 && b!=0 && c!=0 )
{
System.out.println("The perimeter of a Triangle = " + (a+b+c));
}
else {
System.out.println(" invalid inputs ");
}
【问题讨论】:
标签: java