文章

4

粉丝

0

获赞

43

访问

1.8k

头像
求三角形的面积 题解:
P1125 兰州大学/西北工业大学机试题
发布于2026年2月12日 09:19
阅读数 259

#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;                              
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发