/ MYOJ /

记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:8:33: error: no matching function for call to 'getline()'
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                 ^
In file included from /usr/include/stdio.h:859:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate: __ssize_t getline(char**, size_t*, FILE*)
 getline (char **__lineptr, size_t *__n, FILE *__stream)
 ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note:   candidate expects 3 arguments, 0 provided
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6339:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     getline(basic_istream<_CharT, _Traits>&& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6339:5: note:   template argument deduction/substitution failed:
foo.cc:8:33: note:   candidate expects 2 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                 ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6332:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     getline(basic_istream<_CharT, _Traits>&& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6332:5: note:   template argument deduction/substitution failed:
foo.cc:8:33: note:   candidate expects 3 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                 ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6324:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     getline(basic_istream<_CharT, _Traits>& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6324:5: note:   template argument deduction/substitution failed:
foo.cc:8:33: note:   candidate expects 2 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                 ^
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.tcc:1537:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     getline(basic_istream<_CharT, _Traits>& __in,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.tcc:1537:5: note:   template argument deduction/substitution failed:
foo.cc:8:33: note:   candidate expects 3 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                 ^
foo.cc:8:45: error: no matching function for call to 'getline()'
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                             ^
In file included from /usr/include/stdio.h:859:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/c++/7/ext/string_conversions.h:43,
                 from /usr/include/c++/7/bits/basic_string.h:6361,
                 from /usr/include/c++/7/string:52,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note: candidate: __ssize_t getline(char**, size_t*, FILE*)
 getline (char **__lineptr, size_t *__n, FILE *__stream)
 ^~~~~~~
/usr/include/x86_64-linux-gnu/bits/stdio.h:115:1: note:   candidate expects 3 arguments, 0 provided
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6339:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     getline(basic_istream<_CharT, _Traits>&& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6339:5: note:   template argument deduction/substitution failed:
foo.cc:8:45: note:   candidate expects 2 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                             ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6332:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     getline(basic_istream<_CharT, _Traits>&& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6332:5: note:   template argument deduction/substitution failed:
foo.cc:8:45: note:   candidate expects 3 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                             ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.h:6324:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     getline(basic_istream<_CharT, _Traits>& __is,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.h:6324:5: note:   template argument deduction/substitution failed:
foo.cc:8:45: note:   candidate expects 2 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                             ^
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from foo.cc:1:
/usr/include/c++/7/bits/basic_string.tcc:1537:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::getline(std::basic_istream<_CharT, _Traits>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     getline(basic_istream<_CharT, _Traits>& __in,
     ^~~~~~~
/usr/include/c++/7/bits/basic_string.tcc:1537:5: note:   template argument deduction/substitution failed:
foo.cc:8:45: note:   candidate expects 3 arguments, 0 provided
 for(int i=1;i<=n;i++){s=getline();t=getline();if(s==t) tot+=d;}
                                             ^
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1005 史上最简单的问题
语言
C++
递交时间
2021-07-10 22:17:38
评测时间
2021-07-10 22:17:38
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes