求三角形的面积 题解:
#include <stdio.h>
#include <math.h>
#include <string.h>
int main(){
double x1,y1,x2,y2,x3,y3;
while(scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){
double S;
S=0.5*fabs(((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1)));
printf("%.2f\n",S);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发