/ Vijos /

记录详情

Compile Error

foo.cc: In function ‘int main()’:
foo.cc:33:27: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   33 |         for (int i = 0; i < str.size(), i++){
      |                         ~~^~~~~~~~~~~~
foo.cc:33:27: warning: value computed is not used [-Wunused-value]
foo.cc:33:44: error: expected ‘;’ before ‘)’ token
   33 |         for (int i = 0; i < str.size(), i++){
      |                                            ^
      |                                            ;
foo.cc:34:28: warning: comparison with string literal results in unspecified behavior [-Waddress]
   34 |                 if (str[i] == "1"){
foo.cc:34:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

信息

递交者
类型
递交
题目
P1848 记数问题
语言
C++
递交时间
2024-08-22 15:21:27
评测时间
2024-08-22 15:21:27
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes