Submission #4392373


Source Code Expand

#include <cmath>
#include <iostream>

double calc_area( double x_a, double y_a, double x_b, double y_b, double x_c, double y_c )
{
	return std::abs( (x_b-x_a)*(y_c-y_a)-(y_b-y_a)*(x_c-x_a) )*0.5
}

int main (void)
{
	/* variables for main process */
	double x_a, y_a, x_b, y_b, x_c, y_c;


	// STEP.01
	// read out the given data of coordinates
	std::cin >> x_a >> y_a >> x_b >> y_b >> x_c >> y_c;

	// STEP.02
	// output the result
	std::cout << calc_area( x_a, y_a, x_b, y_b, x_c, y_c ) << std::endl;

	// STEP.END
	return 0;
}

Submission Info

Submission Time
Task C - 直訴
User DSCF_1224
Language C++14 (GCC 5.4.1)
Score 0
Code Size 555 Byte
Status CE

Compile Error

./Main.cpp: In function ‘double calc_area(double, double, double, double, double, double)’:
./Main.cpp:7:1: error: expected ‘;’ before ‘}’ token
 }
 ^