Submission #116990
Source Code Expand
#include <math.h> #include <stdio.h> double area_tri ( double x1, double y1, double x2, double y2, double x3, double y3 ) { return fabs( ( ( x2 - x1 ) * ( y3 - y1 ) - ( y2 - y1 ) * ( x3 - x1 ) ) / 2.0; } int main( void ) { double xa, ya, xb, yb, xc, yc; scanf( "%lf %lf %lf %lf %lf %lf", &xa, &ya, &xb, &yb, &xc, &yc ); printf( "%f\n", area_tri( xa, ya, xb, yb, xc, yc ) ); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 直訴 |
User | zeosutt |
Language | C (GCC 4.6.4) |
Score | 0 |
Code Size | 410 Byte |
Status | CE |
Compile Error
./Main.c: In function ‘area_tri’: ./Main.c:5:78: error: expected ‘)’ before ‘;’ token ./Main.c:6:1: error: expected ‘;’ before ‘}’ token ./Main.c: In function ‘main’: ./Main.c:11:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]