/ Vijos /

记录详情

Compile Error

foo.cpp: In function 'int main()':
foo.cpp:11:9: error: no match for 'operator>>' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'int')
     cout>>c;
         ^
foo.cpp:11:9: note: candidates are:
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\string:53:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\locale_classes.h:40,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\ios_base.h:41,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ios:42,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\ostream:38,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:39,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.tcc:996:5: note: template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, std::basic_string<_CharT, _Traits, _Alloc>&)
     operator>>(basic_istream<_CharT, _Traits>& __in,
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\basic_string.tcc:996:5: note:   template argument deduction/substitution failed:
foo.cpp:11:11: note:   'std::ostream {aka std::basic_ostream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
     cout>>c;
           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:879:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:40,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\istream.tcc:955:5: note: template<class _CharT2, class _Traits2> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT2*)
     operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\istream.tcc:955:5: note:   template argument deduction/substitution failed:
foo.cpp:11:11: note:   'std::ostream {aka std::basic_ostream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
     cout>>c;
           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:879:0,
                 from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:40,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\istream.tcc:923:5: note: template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&, _CharT&)
     operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\bits\istream.tcc:923:5: note:   template argument deduction/substitution failed:
foo.cpp:11:11: note:   'std::ostream {aka std::basic_ostream<char>}' is not derived from 'std::basic_istream<_CharT, _Traits>'
     cout>>c;
           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:40:0,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:727:5: note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, unsigned char&)
     operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:727:5: note:   template argument deduction/substitution failed:
foo.cpp:11:11: note:   'std::ostream {aka std::basic_ostream<char>}' is not derived from 'std::basic_istream<char, _Traits>'
     cout>>c;
           ^
In file included from c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\iostream:40:0,
                 from foo.cpp:1:
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:732:5: note: template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(std::basic_istream<char, _Traits>&, signed char&)
     operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
     ^
c:\mingw\lib\gcc\mingw32\4.8.1\include\c++\istream:732:5: note:   template argument deduction/substitution failed:
foo.cpp:11:11: note:   'std::ostream {aka s

信息

递交者
类型
递交
题目
P1000 A+B Problem
语言
C++
递交时间
2016-09-27 21:19:39
评测时间
2016-09-27 21:19:40
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes