Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
129681 | 杨明 | 字符串中最大的数字 | C++ | Accepted | 1 MS | 272 KB | 275 | 2025-09-01 20:29:54 |
#include<bits/stdc++.h> using namespace std; int main() { long long n; cin>>n; if (n<0) n/=-1; int ans = 0; while (n) { // ans = max(ans,n%10); ans = ans > n % 10 ? ans : n % 10; n/=10; } cout<<ans; }