Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

新手求助编译错误Compile Error

Posted by slc14211421 at 2008-09-30 17:13:20 on Problem 1002
Compile Error

Main.cpp
Main.cpp(98) : error C2679: binary '>>' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion); istream(1000): could be 'std::basic_istream<_Elem,_Traits> &std::operator >><std::char_traits<char>>(std::basic_istream<_Elem,_Traits> &,signed char *) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(1007): or       'std::basic_istream<_Elem,_Traits> &std::operator >><std::char_traits<char>>(std::basic_istream<_Elem,_Traits> &,signed char &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(1014): or       'std::basic_istream<_Elem,_Traits> &std::operator >><std::char_traits<char>>(std::basic_istream<_Elem,_Traits> &,unsigned char *) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(1021): or       'std::basic_istream<_Elem,_Traits> &std::operator >><std::char_traits<char>>(std::basic_istream<_Elem,_Traits> &,unsigned char &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(155): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_istream<_Elem,_Traits> &(*)(std::basic_istream<_Elem,_Traits> &)) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(161): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_ios<_Elem,_Traits> &(*)(std::basic_ios<_Elem,_Traits> &)) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(168): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::ios_base &(*)(std::ios_base &)) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(175): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::_Bool &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(194): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(short &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(228): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned short &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(247): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(int &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(273): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned int &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(291): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(long &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(309): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(__w64 unsigned long &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(329): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(__int64 &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(348): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(unsigned __int64 &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(367): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(float &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(386): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(double &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(404): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(long double &) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(422): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(void *&) with [_Elem=char,_Traits=std::char_traits<char>]'; istream(441): or       'std::basic_istream<_Elem,_Traits> &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_streambuf<_Elem,_Traits> *) with [_Elem=char,_Traits=std::char_traits<char>]'; while trying to match the argument list '(std::istream, std::string)'



Main.cpp(105) : error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::string' (or there is no acceptable conversion); ostream(653): could be 'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(700): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<char,std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(738): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const char *) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(785): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,char) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(909): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const signed char *) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(916): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,signed char) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(923): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,const unsigned char *) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(930): or       'std::basic_ostream<_Elem,_Traits> &std::operator <<<std::char_traits<char>>(std::basic_ostream<_Elem,_Traits> &,unsigned char) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(170): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits> &(*)(std::basic_ostream<_Elem,_Traits> &)) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(176): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ios<_Elem,_Traits> &(*)(std::basic_ios<_Elem,_Traits> &)) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(183): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::ios_base &(*)(std::ios_base &)) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(190): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::_Bool) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(210): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(short) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(243): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned short) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(263): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 int) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(288): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned int) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(308): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(328): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__w64 unsigned long) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(349): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(__int64) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(369): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(390): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(float) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(410): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(double) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(430): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(long double) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(450): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(const void *) with [_Elem=char,_Traits=std::char_traits<char>]'; ostream(470): or       'std::basic_ostream<_Elem,_Traits> &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_streambuf<_Elem,_Traits> *) with [_Elem=char,_Traits=std::char_traits<char>]'; while trying to match the argument list '(std::ostream, const std::string)'



用 cin >> 读入字符串 出现错误(98行 )

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator