/*********************************** If文(三角形の判定) ************************************/ import java.util.*; public class If05Triangle { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int a,b,c; System.out.print("3辺の長さを入れて下さい\n"); System.out.print("aはいくつ-->"); a=sc.nextInt(); System.out.print("bはいくつ-->"); b=sc.nextInt(); System.out.print("cはいくつ-->"); c=sc.nextInt(); if ( (a+b>c && b+c>a && c+a>b) && (a==b && b==c) ) System.out.print("正三角形ができます\n"); else if ( a+b>c && b+c>a && c+a>b ) System.out.print("三角形ができます\n"); else System.out.print("三角形ができません\n"); } }