Finding the Order

点我去看原题

解题思路

这道题需要找到特殊情况
即:可以通过判断△ACD是否属于等腰三角形,从而通过判断各边的长度得到C,D的方位是在左边还是右边

Input

2
3 5 5 3
5 3 3 5

Output

AB//CD
AB//DC

AC代码

#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	ios::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr);
    int t;
    cin>>t;
    while(t--)
    {
        int ac,ad,bc,bd;
        cin>>ac>>ad>>bc>>bd;
		//特况是ACD 可能构成等腰三角形
        if(ac != ad)//ACD 非等腰
        {
            if(ac > ad)
                cout<<"AB//DC"<<endl;
            else
                cout<<"AB//CD"<<endl;
        }
        else//ACD 等腰
        {
            if(bc > bd)
                cout<<"AB//CD"<<endl;
            else
                cout<<"AB//DC"<<endl;
        }
    }
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_46425926/article/details/107463672