import java.util.Scanner;
public class loop4{
public static void main(String[] args){
do{
System.out.println("请任意输入3个数,作为三角形的三边");
Scanner aa=new Scanner(System.in),bb=new Scanner(System.in),cc=new Scanner(System.in);
int a=aa.nextInt(),b=bb.nextInt(),c=cc.nextInt();
System.out.println("a="+a);
System.out.println("b="+b);
System.out.println("c="+c);
if(a+b>c && a+c>b && b+c>a)
System.out.println("C="+(a+b+c));
else
System.out.println("不能构成三角形");
}while(a+b>c && a+c>b && b+c>a);
}
}
相关分类