#1791: 斜率...


v00624 (忘ㄌㄝ)


#include<iostream>
using namespace std;
int main()
{
    float x1,y1,x2,y2,x3,y3,a,b,c,d,e;
    while(cin>>d)
    {
    for(e=0;e<d;e++)
       {
         cin>>x1>>y1>>x2>>y2>>x3>>y3;
         a=(y2-y1)/(x2-x1);
         b=(y3-y2)/(x3-x2);
         c=(y1-y3)/(x1-x3);
         if(a==b||a==c||b==c)
         cout<<"NO"<<endl;
         else
         cout<<"YES"<<endl;
       }
    }
    system("pause");
    return 0;
}

我用斜率來判別...

請問哪裡有錯阿....

#1937: Re:斜率...


leopan0922 (zz)


#include
using namespace std;
int main()
{
    float x1,y1,x2,y2,x3,y3,a,b,c,d,e;
    while(cin>>d)
    {
    for(e=0;e       {
         cin>>x1>>y1>>x2>>y2>>x3>>y3;
         a=(y2-y1)/(x2-x1);
         b=(y3-y2)/(x3-x2);
         c=(y1-y3)/(x1-x3);
         if(a==b||a==c||b==c)
         cout<<"NO"<         else
         cout<<"YES"<       }
    }
    system("pause");
    return 0;
}

我用斜率來判別...

請問哪裡有錯阿....


萬一 x的差=0勒
#2118: Re:斜率...


df405102 (skull)


#include
using namespace std;
int main()
{
    float x1,y1,x2,y2,x3,y3,a,b,c,d,e;
    while(cin>>d)
    {
    for(e=0;e       {
         cin>>x1>>y1>>x2>>y2>>x3>>y3;
         a=(y2-y1)/(x2-x1);
         b=(y3-y2)/(x3-x2);
         c=(y1-y3)/(x1-x3);
         if(a==b||a==c||b==c)
         cout<<"NO"<         else
         cout<<"YES"<       }
    }
    system("pause");
    return 0;
}

我用斜率來判別...

請問哪裡有錯阿....

 

 

其實沒有那麼麻煩啦

那天我們去比賽的時候

這題寫完後只有測試範例輸入就送出去judge了

用行列式就可以了啊

輕鬆明瞭