wang13426564043 发表于 2020-10-28 21:55:47

求各位看下有什么问题!!

#include <stdio.h>
#include <math.h>
int main(void)

{
        double la, lb, lc, cosc, sinc, area;
        scanf_s(" %f, %f, %f", &la, &lb, &lc);
        cosc = la * la + lb * lb - lc * lc / 2 *la * lb;
        sinc = sqrt(1 - cosc * cosc);
        area = la * lb * sinc / 2;
        printf("%.6f", area);
        return 0;
}

jitianmoshen 发表于 2020-10-28 22:28:05

scanf_s("%lf%lf%lf", &la, &lb, &lc)
double类型用%lf,
页: [1]
查看完整版本: 求各位看下有什么问题!!