top1编程
← 返回题目
题解

【入门】闯关大冒险

1 条题解

  • 0
    @ 2026-7-28 22:44:49
    #include <bits/stdc++.h>
    using namespace std;
    
    int main()
    {
    	int n;
    	cin >> n;
    	int a, b, c, d;
    	a = n / 1000 % 10;
    	b = n / 100 % 10;
    	c = n / 10 % 10;
    	d = n % 10;
    	cout << max(max(a, b), max(c, d));
    	return 0;
    }
    
    • 1