Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62015 刘世杰 水下探测器 C++ Compile Error 0 MS 0 KB 345 2023-12-16 16:57:41

Tests(0/0):


Code:

#include<iostream> #include<string> using namespace std; int main() { int h,s,x; char a[105]; x = strlen(a); cin >> h >> s; cin >> a; for(int i = 1;i <= x;i++) { if(a[i] == 'd' && s > 0) s--; if(a[i] == 'u' && s < h) s++; } cout << s; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:17: error: 'strlen' was not declared in this scope
     x = strlen(a);
                 ^