1 solutions

  • 0
    @ 2025-11-27 11:55:04

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long
    int main() {
        int n;
        cin >> n;
        int x = 0;
        for (int i = 0; i < n; i++) {
            int smu = 0;
            ll tmp;
            cin >> tmp;
            while (tmp > 0) {
                smu += tmp % 10;
                tmp /= 10;
            }
            x = max(x, smu);
        }
        cout << x << endl;
        return 0;
    }
    
    • 1

    Information

    ID
    31
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By