Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:8:30: 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<=a.size();i++){
      |                             ~^~~~~~~~~~
/in/foo.cc:9:47: warning: value computed is not used [-Wunused-value]
    9 |                         if(a[i]<'9')ans*2+a[i]-'0';
      |                                     ~~~~~~~~~~^~~~
/in/foo.cc:10:51: error: expected ';' before '}' token
   10 |                         else ans=ans*2+a[i]-'A'+10
      |                                                   ^
      |                                                   ;
   11 |                 }
      |                 ~                                  

信息

递交者
类型
自测
题目
P2605 进制转换4级1 202309
语言
C++
递交时间
2026-04-11 14:20:37
评测时间
2026-04-14 18:35:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes