5 solutions

  • 1
    @ 2022-4-4 17:33:20

    C++

    #include <iostream>
    using namespace std;
    int main()
    {
        int n = 0;
        cin >> n;
        int t = n;
        int sum = 0;
        while(n > 0)
        {
            sum += (n % 10) * (n % 10) * (n % 10);
            n /= 10;
        }
        if(sum == t)    cout << "TRUE" << endl;
        else cout << "FALSE" << endl;
        return 0;
    }
    

    Information

    ID
    42
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    5
    Tags
    # Submissions
    893
    Accepted
    314
    Uploaded By