Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:9:17: error: unable to find numeric literal operator 'operator""to10'
    9 |         int n10=8to10(s);
      |                 ^~~~~
/in/foo.cc:9:17: note: use '-fext-numeric-literals' to enable more built-in suffixes
/in/foo.cc: In function 'int _8to10(std::string)':
/in/foo.cc:16:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |         for(int i=0;i<s.size();i++)
      |                     ~^~~~~~~~~
/in/foo.cc: In function 'std::string _10to16(int)':
/in/foo.cc:22:24: error: could not convert ''0'' from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   22 |         if(x==0)return '0';
      |                        ^~~
      |                        |
      |                        char
/in/foo.cc:26:50: error: expected ';' before 'else'
   26 |                 if(x%16<10)ret=ret+char(x%16+'0')
      |                                                  ^
      |                                                  ;
   27 |                 else ret=ret+char(x%16-10+'a');
      |                 ~~~~                              

信息

递交者
类型
递交
题目
P3116 古籍翻译
语言
C++
递交时间
2026-05-23 14:01:44
评测时间
2026-05-23 14:01:44
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes