Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62413 黎瑾萱 字符串中最大的数字 C++ Compile Error 0 MS 0 KB 230 2023-12-23 16:58:53

Tests(0/0):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ char n[1000]; cin>>n; int m = strlen(a); int max = '0'; for(int i=0;i<n;i++){ if(n[i]>max){ max = n[i]; } } cout<<max; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:17: error: 'a' was not declared in this scope
  int m = strlen(a);
                 ^
Main.cc:9:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  for(int i=0;i