4 条题解

  • 0
    @ 2024-08-21 10:17:56

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    int sxh(int x)
    {
    x -= '0';
    int t = x * x * x;
    return t;
    }
    int main()
    {
    char n[100];
    gets(n);

    int len = strlen(n);
    int sum = 0;
    for (int i = 0; i < len; i++)
    {
    sum += sxh(n[i]);
    }
    int n1 = atoi(n);
    if (sum == n1)
    printf("YES");
    else
    printf("NO");
    }

  • 0
    @ 2022-07-27 22:10:58

    #include <bits/stdc++.h>
    using namespace std;
    int GetNum(int x)
    {
    int sum=0;
    for(;x>0;x=x/10)
    {
    int x1=x%10;
    sum+=x1*x1*x1;
    }
    return sum;
    }
    int main()
    {
    int x=153;
    cin>>x;
    int y=GetNum(x);
    if(x==y)
    cout<<"YES";
    else
    cout<<"NO";

    return 0;
    }

  • 0

    #include <iostream>
    using namespace std;
    int main()
    {
    int x1,x2,x3,x;

    cin>>x;
    x1=x%10;
    x2=((x-x1)/10)%10;
    x3=(x-x%100)/100;
    if(x1*x1*x1+x2*x2*x2+x3*x3*x3==x)
    cout<<"YES"<<endl;
    else
    cout<<"NO"<<endl;
    return 0;
    }

  • 0

    #include <iostream>
    #include <cmath>
    using namespace std;

    int GetNum(int x);

    int main()
    {
    int x=153; cin>>x;
    int y=GetNum(x);
    if(x==y)
    cout<<"YES";
    else
    cout<<"NO";
    return 0;
    }

    int GetNum(int x)
    {
    int sum=0;
    for(; x>0; x=x/10)
    {
    int x1=x%10;
    sum += x1*x1*x1;
    }
    return sum;
    }

  • 1

信息

ID
1092
难度
4
分类
(无)
标签
递交数
282
已通过
114
通过率
40%
被复制
11
上传者