Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
155856 余建成 字符串中最大的数字II C++ Accepted 1 MS 276 KB 246 2026-06-14 10:56:19

Tests(10/10):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ char n[50]={}; cin>>n; int l=strlen(n),max=0; for(int i=0;i<l;i++){ if(n[i]=='.')continue; if(n[i]-'0'>=max)max=n[i]-'0'; } cout<<max<<endl; return 0; }