Compile Error

foo.cc: In function ‘int main()’:
foo.cc:7:10: error: ‘p’ was not declared in this scope
    7 |     cin>>p>>st;
      |          ^
foo.cc:8:18: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    8 |     for(int i=1;i<=st.size()-1;i++)
      |                 ~^~~~~~~~~~~~~
foo.cc:11:17: error: ‘sum’ was not declared in this scope
   11 |                 sum=sum*p+st[i];
      |                 ^~~
foo.cc:13:17: error: ‘sum’ was not declared in this scope
   13 |                 sum=sum*p+st[i]-'A'+10;
      |                 ^~~
foo.cc:15:11: error: ‘sum’ was not declared in this scope
   15 |     cout<<sum;
      |           ^~~

信息

递交者
类型
递交
题目
P2521 P进制转十进制
语言
C++
递交时间
2025-05-10 14:45:46
评测时间
2025-05-10 14:45:46
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes