Submission #4983341


Source Code Expand

#include <stdio.h>

int main()
{
	int x[6], i;
	for (int i = 0; i < 6; i++) scanf("%d", &x[i]);
	printf("%f\n", fabs((x[2] - x[0])*(x[5] - x[1]) - (x[3] - x[1])*(x[4] - x[1]) / 2);
}

Submission Info

Submission Time
Task C - 直訴
User MkRw
Language C (GCC 5.4.1)
Score 0
Code Size 189 Byte
Status CE

Compile Error

./Main.c: In function ‘main’:
./Main.c:7:17: warning: implicit declaration of function ‘fabs’ [-Wimplicit-function-declaration]
  printf("%f\n", fabs((x[2] - x[0])*(x[5] - x[1]) - (x[3] - x[1])*(x[4] - x[1]) / 2);
                 ^
./Main.c:7:17: warning: incompatible implicit declaration of built-in function ‘fabs’
./Main.c:7:17: note: include ‘<math.h>’ or provide a declaration of ‘fabs’
./Main.c:7:84: error: expected ‘)’ before ‘;’ token
  printf("%f\n", fabs((x[2] - x[0])*(x[5] - x[1]) - (x[3] - x[1])*(x[4] - x[1]) / 2);
                                                                                    ^
./Main.c:8:1: error: expected ‘;’ before ‘}’ token
 }
 ^
./Main.c:6:30: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
  for (int i = 0; i < 6; i++) scanf("%d", &x[i]);
                              ^