Compile Error

/in/foo.cc: In function 'std::string f(std::string)':
/in/foo.cc:10:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |         for(int i=1;i<=s.size();i++)
      |                     ~^~~~~~~~~~
/in/foo.cc:17:19: error: could not convert '((ok != 0) && (ko != 0))' from 'bool' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   17 |         return (ok&&ko);
      |                ~~~^~~~~
      |                   |
      |                   bool
/in/foo.cc: In function 'int main()':
/in/foo.cc:25:21: error: could not convert 'f(std::string)()' from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
   25 |                 if(f(s[i]))
      |                    ~^~~~~~
      |                     |
      |                     std::string {aka std::__cxx11::basic_string<char>}

信息

递交者
类型
递交
题目
P3012 密码强度202512GESP3级T1
语言
C++
递交时间
2025-12-30 20:13:11
评测时间
2025-12-30 20:13:11
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes