Compile Error

foo.cc: In function 'int main()':
foo.cc:13:21: error: no match for 'operator<<' (operand types are 'std::ios_base&(std::ios_base&)' and 'std::_Setprecision')
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                ~~~~~^~~~~~~~~~~~~~~~~
      |                |                  |
      |                |                  std::_Setprecision
      |                std::ios_base&(std::ios_base&)
In file included from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/string:53,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/locale_classes.h:40,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:41,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ios:42,
                 from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:38,
                 from iostream:39:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/basic_string.h:3891:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Alloc>&)'
 3891 |     operator<<(basic_ostream<_CharT, _Traits>& __os,
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/basic_string.h:3891:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
In file included from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/ios_base.h:46:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/system_error:335:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
  335 |     operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/system_error:335:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:507:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
  507 |     operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:507:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:517:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
  517 |     operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:517:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:523:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
  523 |     operator<<(basic_ostream<char, _Traits>& __out, char __c)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:523:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:534:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
  534 |     operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:534:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:539:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
  539 |     operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:539:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:598:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
  598 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:598:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
In file included from /nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:833:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
  307 |     operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/bits/ostream.tcc:307:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:615:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
  615 |     operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:615:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:628:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
  628 |     operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:628:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:633:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
  633 |     operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:633:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<char, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:754:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
  754 |     operator<<(_Ostream&& __os, const _Tp& __x)
      |     ^~~~~~~~
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:754:5: note:   template argument deduction/substitution failed:
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::ios_base& (&)(std::ios_base&); _Tp = std::_Setprecision]':
foo.cc:13:37:   required from here
/nix/store/hf2gy3km07d5m0p1lwmja0rg9wlnmyr7-gcc-12.3.0/include/c++/12.3.0/ostream:754:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
In file included from foo.cc:2:
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:79:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Resetiosflags)'
   79 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Resetiosflags __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:79:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:109:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Setiosflags)'
  109 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setiosflags __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:109:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:143:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Setbase)'
  143 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setbase __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:143:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:178:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Setfill<_CharT>)'
  178 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setfill<_CharT> __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:178:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:208:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Setprecision)'
  208 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setprecision __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:208:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:238:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Setw)'
  238 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Setw __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:238:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:311:5: note: candidate: 'template<class _CharT, class _Traits, class _MoneyT> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Put_money<_MoneyT>)'
  311 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_money<_MoneyT> __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:311:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:363:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _Put_time<_CharT>)'
  363 |     operator<<(basic_ostream<_CharT, _Traits>& __os, _Put_time<_CharT> __f)
      |     ^~~~~~~~
/nix/store/x8r9w26yn4sfv0qf2i3jhay214dk6895-gcc/include/c++/12.3.0/iomanip:363:5: note:   template argument deduction/substitution failed:
foo.cc:13:37: note:   mismatched types 'std::basic_ostream<_CharT, _Traits>' and 'std::ios_base&(std::ios_base&)'
   13 |     double ans=fixed<<setprecision(2)<<sqrt(p*(p-a)*(p-b)*(p-c));
      |                                     ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P2326 1.3.17:计算三角形面积
语言
C++
递交时间
2023-12-19 22:52:08
评测时间
2023-12-19 22:52:08
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes