Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
124982 李俊博 字符串中最大的数字 C++ Accepted 1 MS 272 KB 489 2025-07-13 09:27:47

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ /* cin>>a; cin>>b; int ar=strlen(a); int br=strlen(b); if(a>b){ cout<<a; } else if(a<b){ cout<<b; } else{ int f=strcmp(a,b); if(f==1){ cout<<a; } else if(f==-1){ cout<<b; } else{ cout<<"="; } } */ long long n; cin>>n; int m=0; if(n<0){ n=-1*n; } while(n>0){ if(m<n%10){ m=n%10; } n=n/10; } cout<<m; return 0; }