Mã chấm: 269832
Main.cc: In function ‘int main()’: Main.cc:27:21: error: ‘k’ was not declared in this scope k=k+int(s[0]+48); ^ Main.cc:28:44: error: no match for ‘operator=’ (operand types are ‘std::__cxx11::string {aka std::__cxx11::basic_string}’ and ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’) s=s.erase(s.begin() + 0) ^ 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/istream:38, from /usr/include/c++/7/sstream:38, from /usr/include/c++/7/complex:45, from /usr/include/c++/7/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52, from Main.cc:1: /usr/include/c++/7/bits/basic_string.h:654:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator] operator=(const basic_string& __str) ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:654:7: note: no known conversion for argument 1 from ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’ to ‘const std::__cxx11::basic_string&’ /usr/include/c++/7/bits/basic_string.h:693:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(const _CharT*) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator] operator=(const _CharT* __s) ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:693:7: note: no known conversion for argument 1 from ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’ to ‘const char*’ /usr/include/c++/7/bits/basic_string.h:704:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(_CharT) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator] operator=(_CharT __c) ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:704:7: note: no known conversion for argument 1 from ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’ to ‘char’ /usr/include/c++/7/bits/basic_string.h:722:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&&) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator] operator=(basic_string&& __str) ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:722:7: note: no known conversion for argument 1 from ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’ to ‘std::__cxx11::basic_string&&’ /usr/include/c++/7/bits/basic_string.h:785:7: note: candidate: std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator=(std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits; _Alloc = std::allocator] operator=(initializer_list<_CharT> __l) ^~~~~~~~ /usr/include/c++/7/bits/basic_string.h:785:7: note: no known conversion for argument 1 from ‘std::__cxx11::basic_string::iterator {aka __gnu_cxx::__normal_iterator >}’ to ‘std::initializer_list’ Main.cc:9:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen("donhang.inp","r",stdin); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ Main.cc:10:12: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result] freopen("donhang.out","w",stdout); ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~