[問題] Compilation error
我寫同一個題目在zerojudge已經AC了
可是在UVA卻出現以下訊息
code.cpp: In function 'int main()':
code.cpp:11: error: call of overloaded 'abs(int)' is ambiguous
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:94: note:
candidates are: double std::abs(double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:98: note:
float std::abs(float)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:102: note:
long double std::abs(long double)
code.cpp:12: error: call of overloaded 'abs(int)' is ambiguous
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:94: note:
candidates are: double std::abs(double)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:98: note:
float std::abs(float)
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.5/include/g++-v4/cmath:102: note:
long double std::abs(long dou
麻煩大大解惑
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 123.204.81.220
→
08/30 15:53, , 1F
08/30 15:53, 1F
→
08/30 15:53, , 2F
08/30 15:53, 2F
→
08/30 15:55, , 3F
08/30 15:55, 3F
→
08/30 15:56, , 4F
08/30 15:56, 4F
推
08/30 16:27, , 5F
08/30 16:27, 5F
→
08/30 16:54, , 6F
08/30 16:54, 6F