import java.util.*; import java.math.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ BigDecimal a = sc.nextBigDecimal(); BigDecimal b = sc.nextBigDecimal(); BigDecimal c = sc.nextBigDecimal(); if(a.add(b).compareTo(c) > 0 && a.add(c).compareTo(b) > 0 &&c.add(b).compareTo(a) > 0){ System.out.println("Yes"); }else{ System.out.println("No"); } } } }
//最小值+中间值>最大值即成立 可自行证明 import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Test9 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while(sc.hasNext()) { String str = sc.nextLine(); String[] ss = str.split(" "); BigInteger a = new BigInteger(ss[0]); BigInteger b = new BigInteger(ss[1]); BigInteger c = new BigInteger(ss[2]); //找出a b c 三边最大边,最小,和中间值 //如果max<middle+min,就可以构成三角形 BigInteger max=null; BigInteger mid=null; BigInteger min=null; List<BigInteger> list = new ArrayList(); list.add(a); list.add(b); list.add(c); list.sort(null); //成立条件 if(list.get(0).add(list.get(1)).compareTo(list.get(2))>0) { System.out.println("Yes"); }else{ System.out.println("No"); } } } }