Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
98072 李明秦 03字符转ASCLL码 C++ Compile Error 0 MS 0 KB 132 2024-11-17 11:57:49

Tests(0/0):


Code:

#include<iostream> using namespace std; int main() { char zm;456456456456+ cin>>zm ; cout<<(int)zm<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:5:22: error: no match for 'operator+' (operand types are 'long int' and 'std::istream {aka std::basic_istream}')
  char zm;456456456456+
                      ^
Main.cc:5:22: note: candidate: operator+(long int, int) 
Main.cc:5:22: note:   no known conversion for argument 2 from 'std::istream {aka std::basic_istream}' to 'int'
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/stl_iterator.h:334:5: note: candidate: template std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)
     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/5/bits/stl_iterator.h:334:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   'std::istream {aka std::basic_istream}' is not derived from 'const std::reverse_iterator<_Iterator>'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/5/bits/char_traits.h:39,
                 from /usr/include/c++/5/ios:40,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/stl_iterator.h:1152:5: note: candidate: template std::move_iterator<_Iterator> std::operator+(typename std::move_iterator<_Iterator>::difference_type, const std::move_iterator<_Iterator>&)
     operator+(typename move_iterator<_Iterator>::difference_type __n,
     ^
/usr/include/c++/5/bits/stl_iterator.h:1152:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   'std::istream {aka std::basic_istream}' is not derived from 'const std::move_iterator<_Iterator>'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4783:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4783:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:53:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.tcc:1151:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/5/bits/basic_string.tcc:1151:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const _CharT*' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:53:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.tcc:1167:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs)
     ^
/usr/include/c++/5/bits/basic_string.tcc:1167:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   'std::istream {aka std::basic_istream}' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4820:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, const _CharT*)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4820:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4836:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, _CharT)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs)
     ^
/usr/include/c++/5/bits/basic_string.h:4836:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4848:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4848:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4854:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4854:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4860:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4860:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4872:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(const _CharT* __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4872:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'const _CharT*' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4878:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&)
     operator+(_CharT __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4878:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   'std::istream {aka std::basic_istream}' is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4884:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, const _CharT*)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4884:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^
In file included from /usr/include/c++/5/string:52:0,
                 from /usr/include/c++/5/bits/locale_classes.h:40,
                 from /usr/include/c++/5/bits/ios_base.h:41,
                 from /usr/include/c++/5/ios:42,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from Main.cc:1:
/usr/include/c++/5/bits/basic_string.h:4890:5: note: candidate: template std::__cxx11::basic_string<_CharT, _Traits, _Alloc> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&, _CharT)
     operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs,
     ^
/usr/include/c++/5/bits/basic_string.h:4890:5: note:   template argument deduction/substitution failed:
Main.cc:7:2: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>' and 'long int'
  cin>>zm ;
  ^