java相似三角形
阿新 • • 發佈:2019-01-29
NO YES NO
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner reader=new Scanner(System.in); while(reader.hasNext()) { int a1,a2,b1,b2,c1,c2; a1=reader.nextInt(); b1=reader.nextInt(); c1=reader.nextInt(); a2=reader.nextInt(); b2=reader.nextInt(); c2=reader.nextInt(); int t; if(a1<b1) { t=a1;a1=b1;b1=t; } if(a1<c1) { t=a1;a1=c1;c1=t; } if(b1<c1) { t=b1;b1=c1;c1=t; } if(a2<b2) { t=a2;a2=b2;b2=t; } if(a2<c2) { t=a2;a2=c2;c2=t; } if(b2<c2) { t=b2;b2=c2;c2=t; } if((c1+b1>a1) && (c2+b2>a2)) { if((a1*b2==b1*a2) && (a1*c2==c1*a2) && (b1*c2==c1*b2)) { System.out.println("YES"); } else { System.out.println("NO"); } } else { System.out.println("NO"); } } } }