| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73387 | LJY | 字符串中最大的数字II | C++ | Accepted | 1 MS | 272 KB | 454 | 2024-05-18 19:01:15 |
#include <iostream> #include <string> #include <cctype> // For isdigit function using namespace std; int main() { string input; cin >> input; char maxDigit = '0'; // 初始化为最小的数字字符 // 遍历字符串寻找最大的数字字符 for (char ch : input) { if (isdigit(ch) && ch > maxDigit) { maxDigit = ch; } } cout << maxDigit << endl; return 0; }