记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:10:13: error: no matching function for call to 'round(int&, int)'
  s=round(d,1);
             ^
In file included from /usr/include/features.h:424:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
                 from /usr/include/c++/7/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: double round(double)
 __MATHCALLX (round,, (_Mdouble_ __x), (__const__));
 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:41:0,
                 from foo.cc:1:
/usr/include/c++/7/cmath:1771:3: note: candidate: constexpr float std::round(float)
   round(float __x)
   ^~~~~
/usr/include/c++/7/cmath:1771:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/cmath:1775:3: note: candidate: constexpr long double std::round(long double)
   round(long double __x)
   ^~~~~
/usr/include/c++/7/cmath:1775:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/cmath:1783:5: note: candidate: template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::round(_Tp)
     round(_Tp __x)
     ^~~~~
/usr/include/c++/7/cmath:1783:5: note:   template argument deduction/substitution failed:
foo.cc:10:13: note:   candidate expects 1 argument, 2 provided
  s=round(d,1);
             ^

信息

递交者
类型
递交
题目
求梯形面积
语言
C++
递交时间
2021-01-27 20:48:38
评测时间
2021-01-27 20:48:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes