Submission #118873


Source Code Expand

#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <math.h>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    int xa,ya,xb,yb,xc,yc;
	cin >> xa >> ya >> xb >> yb >> xc >> yc;
	xb -= xa;
	xc -= xa;
	yb -= ya;
	yc -= ya;
	float ans = abs(float(xb*yc - xc*yb)) / 2;
	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task C - 直訴
User wena0715
Language C++ (G++ 4.6.4)
Score 0
Code Size 399 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:19:38: error: call of overloaded ‘abs(float)’ is ambiguous
./Main.cpp:19:38: note: candidates are:
/usr/include/stdlib.h:771:12: note: int abs(int)
/usr/include/c++/4.6/cstdlib:173:3: note: long long int __gnu_cxx::abs(long long int)
/usr/include/c++/4.6/cstdlib:139:3: note: long int std::abs(long int)