C语言求凸多边形面积, polygon * polygon.c // gcc polygon.c -Wall -lm #include <stdio.h> #include <stdlib.h> #include <math.h> #ifndef null #define null ((void *)0) #endif typedef struct { float x; float y; } Point; typedef struct { Point p1; Point p2; } Line; typedef Poin...
输入边数 n, 输入 多边形各顶点 x,y 坐标,逆时针顺序 (保证 叉乘积 为 正)。各顶点 x,y 坐标 减去 a[0][0]。以 a[0][0] 为主 计算各三角形面积并累加。include <stdio.h> include <stdlib.h> main( ){ int i,j,n;double s=0;double a[15][2];scanf("%d",&n);for(...
【问题描述】 给出平面上一组顶点的坐标,计算出它们所围成的凸多边形的面积. 输入数据表示了如图所示的四边形。其面积为5.00。 评分标准: 本程序允许使用数学库函数,如果你的输出与标准答案相差不超过0.02则得满分。 【输入形式】 从标准输入读取N(3≤N≤15)行,每行两个数字(由空格隔开),分别表示该点的X、Y...