/*
* 知识点回顾:自动类型转换
* 强制类型转换
*
* 注意事项:本题中数字为无序,我们需将它排序
*/
import java.util.*;
class Triangle{
int a,b,c;
Triangle(int a,int b,int c){
this.a=a;
this.b=b;
this.c=c;
}
boolean IsTriangle(){
if(a+b>c&&a-b<c) return true;
else return false;
}
/*boolean judge(){
Triangle A=new Triangle()
}
*/
}
public class Main {
public static void main(String args[]){
Scanner input=new Scanner(System.in);
while(input.hasNext()){//注意!!!是无序输入 排序!!!
int a1=input.nextInt();
int b1=input.nextInt();
int c1=input.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=c1;c1=b1;b1=t;}
int a2=input.nextInt();
int b2=input.nextInt();
int c2=input.nextInt();
if(a2>b2){ t=b2;b2=a2;a2=t;}
if(a2>c2) {t=c2;c2=a2;a2=t;}
if(b2>c2) {t=c2;c2=b2;b2=t;}
Triangle A=new Triangle(a1,b1,c1);
Triangle B=new Triangle(a2,b2,c2);
int f=1;
double a=(double)a1/a2;
double b=(double)b1/b2;
double c=(double)c1/c2;
System.out.println(a+" "+b+" "+c);
if(!A.IsTriangle()||!B.IsTriangle())
f=0;
if(f==1){
if(a==b&&b==c)
System.out.println("YES");
else System.out.println("NO");
}
else System.out.println("NO");
}
}
}
相似三角形
最新推荐文章于 2022-08-11 13:15:03 发布