Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
7525 詹梓涵 字符串中最大的数字 C++ Accepted 0 MS 256 KB 478 2025-05-03 10:22:04

Tests(10/10):


Code:

#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 n[12]={},z=0; cin>>n; for(int i=0;i<=strlen(n);i++){ if(n[i]=='-'){ continue; } else{ z=max(z,n[i]); } } cout<<z<<endl; return 0; }