Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
157681 王润中 字符串中最大的数字II C++ Accepted 1 MS 272 KB 298 2026-08-15 09:54:17

Tests(10/10):


Code:

#include<iostream> #include<cstring> using namespace std; int main(){ char a[15]; gets(a); int len=strlen(a); int max=a[0]-'0'; for(int i=1;i<len;i++){ if(a[i]=='.'){ continue; } else{ if(a[i]-'0'>max){ max=a[i]-'0'; } } } cout<<max; }