Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62705 张江鹏 字符串中最大的数字 C++ Compile Error 0 MS 0 KB 194 2023-12-24 18:05:04

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ char s[15]; cin>>s; int ls=strlen[s]; char mx=0; for(int i=0;i<ls;i++){ if(s[i]>mx){ mx=s[i]; } } cout<<mx; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:6:17: error: invalid types 'size_t(const char*) throw () {aka long unsigned int(const char*) throw ()}[char [15]]' for array subscript
  int ls=strlen[s];
                 ^