只要知道一个公式就行。。。高中知识。。。然而上了大学忘得差不多了。。。
平行四边形的面积可以用两个向量的叉乘计算:a(x1,y1) b(x2,y2) (a,b都是向量,不是点) S=x1*y2-x2*y1;
应用到题目里就是 (x1-x2)*(y3-y2)-(x3-x2)*(y1-y2); 然后注意取绝对值就行
import java.util.*;
public class Main{
static Scanner sc= new Scanner(System.in);
public static void main(String[] args) {
int t;
int x1,y1,x2,y2,x3,y3,x4,y4;
double s;
t=sc.nextInt();
for(int j=1;j<=t;j++) {
x1=sc.nextInt();
y1=sc.nextInt();
x2=sc.nextInt();
y2=sc.nextInt();
x3=sc.nextInt();
y3=sc.nextInt();
x4=x1-(x2-x3);
y4=y1-(y2-y3);
s=(x1-x2)*(y3-y2)-(x3-x2)*(y1-y2);
System.out.print("Case "+j+": "+x4+" "+y4+" ");
System.out.printf("%.0f\n",Math.abs(s));
}
}
}