链接:http://www.51nod.com/Challenge/Problem.html#!#problemId=1265
把他们转化为行列式
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,k,t,n,x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4,r1,r2,r3,r4,r5,r6,r7,r8,r9;
scanf("%d",&t);
while(t--)
{
scanf("%d%d%d",&x1,&y1,&z1);
scanf("%d%d%d",&x2,&y2,&z2);
scanf("%d%d%d",&x3,&y3,&z3);
scanf("%d%d%d",&x4,&y4,&z4);
r1=x1-x2,r2=y1-y2,r3=z1-z2;
r4=x1-x3,r5=y1-y3,r6=z1-z3;
r7=x1-x4,r8=y1-y4,r9=z1-z4;
if(r1*r5*r9+r2*r6*r7+r3*r8*r4-r1*r8*r6-r2*r4*r9-r3*r5*r7==0)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
return 0;
}