Submission #111968
Source Code Expand
#include <iostream> #include <string> #include <math.h> #include <algorithm> using namespace std; int main() { double xa,ya,xb,yb,xc,yc,hoge,fuga; cin>>xa>>ya>>xb>>yb>>xc>>yc; xb -= xa; xc -= xa; yb -= ya; yc -= ya; hoge = abs(static_cast<double>(xb*yc) - static_cast<double>(xc*yb))/2; fuga = hoge*10; if((int)fuga % 10 == 0) cout<<hoge<<".0"<<endl; else cout<<hoge<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 直訴 |
User | spade630 |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 435 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:18:68: error: call of overloaded ‘abs(double)’ is ambiguous ./Main.cpp:18:68: 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)