Compile Error

/in/foo.cc:3:9: error: expected unqualified-id before 'int'
    3 | int n,k,int kto10(string int);;
      |         ^~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:11:31: error: could not convert 'k' from 'int' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   11 |                 cout<<kto10(s,k)<<endl;
      |                               ^
      |                               |
      |                               int
/in/foo.cc: At global scope:
/in/foo.cc:15:20: error: 'k' is not a type
   15 | int kto10(string s,k)
      |                    ^
/in/foo.cc: In function 'int kto10(std::string, int)':
/in/foo.cc:18:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |         for(int i=0;i<=s.size();i++)
      |                     ~^~~~~~~~~~

信息

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