您好我知道代码不完整但是我试图找到三角形的区域,但是我很难找到合适的函数来放置以及返回哪个获得输出。我知道我会返回等式,但我不知道应该将area1 =设置为
#include <stdio.h>
#include <math.h>
double calculateArea(double, double, double, double, double, double);
int main () {
double x1, x2, x3, y1, y2, y3, area1, premiter1;
printf("Enter the coordinate planes");
scanf("%lf", &x1);
scanf("%lf", &y1);
scanf("%lf", &x2);
scanf("%lf", &y2);
scanf("%lf", &x3);
scanf("%lf", &y3);
area1 =
printf("Area : %lf", area1);
return 0;
}
double calculateArea() {
return
}
答案 0 :(得分:0)
没有完全理解你的问题,但似乎这是要实现的目标:
#include <stdio.h>
#include <math.h>
double calculateArea(double, double, double, double, double, double);
int main () {
double x1, x2, x3, y1, y2, y3, area1, premiter1;
printf("Enter the coordinate planes");
scanf("%lf", &x1);
scanf("%lf", &y1);
scanf("%lf", &x2);
scanf("%lf", &y2);
scanf("%lf", &x3);
scanf("%lf", &y3);
area1 = calculateArea(x1, y1, x2, y2, x3, y3);
printf("Area : %lf", area1);
return 0;
}
double calculateArea(double x1, double y1, double x2, double y2, double x3, double y3) {
double area;
//your logic here.
return area;
}
同样,你可以使用周边。