Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
118312 | 蔡书涵 | 字符串中最大的数字II | C++ | Accepted | 0 MS | 276 KB | 526 | 2025-04-26 18:23:49 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ char s[11]; cin>>s; int max=0; int a=strlen(s); for(int i=0;i<a;i++){ if(s[i]=='.'){ continue; } int n=s[i]-'0'; if(n>max){ max=n; } } cout<<max<<endl; return 0; }