3 条题解

  • 0

    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    int x,a,b,c;
    for(x=100;x<=999;x++)
    {
    a=x/100;
    b=(x-a*100)/10;
    c=x%10;
    if(a*a*a+b*b*b+c*c*c==x)
    cout<<x<<" ";

    }
    return 0;
    }

  • 0

    #include<iostream>
    #include<cmath>
    #include<iomanip>
    using namespace std;
    int main()
    {
    int x,a,b,c;
    for(x=100;x<=999;x++)
    {
    a=x/100;
    b=(x-a*100)/10;
    c=x%10;
    if(a*a*a+b*b*b+c*c*c==x)
    cout<<x<<" ";

    }
    return 0;
    }

  • -1
    @ 2022-05-05 09:11:51

    #include<iostream>
    using namespace std;

    int main()
    {
    int num = 100;
    do
    {
    int a = 0;
    int b = 0;
    int c = 0;
    a = num % 10;
    b = num / 10 % 10;
    c = num / 100;
    if (a*a*a + b*b*b + c*c*c == num)
    {
    cout << num << " ";
    }
    num++;
    } while (num < 1000);
    cout << endl;
    system("pause");
    return 0;
    }

  • 1

信息

ID
1044
难度
4
分类
(无)
标签
递交数
246
已通过
106
通过率
43%
上传者