fork(1) download
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main(void)
  5. {
  6. double xA, yA, xB, yB, xC, yC, S; // описание переменных
  7. printf("Coordinates of point A:\n"); //ввод координат вершин треугольника
  8. scanf("%lf %lf", &xA, &yA);
  9. printf("Coordinates of point B:\n");
  10. scanf("%lf %lf", &xB, &yB);
  11. printf("Coordinates of point C:\n");
  12. scanf("%lf %lf", &xC, &yC);
  13. S=fabs((xB-xA)*(yC-yA)-(xC-xA)*(yB-yA))/2.0; //вычисление площади
  14. printf("Square=%8lg",S);
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 3300KB
stdin
0 0 0 4 5 0
stdout
Coordinates of point A:
Coordinates of point B:
Coordinates of point C:
Square=      10