Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
102714 王珠潏 字符串中最大的数字 C++ Accepted 1 MS 272 KB 257 2024-12-22 14:52:57

Tests(10/10):


Code:

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