4 条题解
-
0Infinity_ LV 8 @ 2024-06-12 20:25:36
答案:153 370 371 407
#include<iostream> #include<cmath> using namespace std; int main(){ ios::sync_with_stdio(false); for(int i = 100; i <= 999; i++){ if(pow((i / 100), 3) + pow(i / 10 % 10, 3) + pow(i % 10, 3) == i)cout << i << " "; } return 0; }
-
02022-01-28 09:15:49@
#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;
} -
02021-12-27 09:29:08@
#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;
} -
-12022-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
- 分类
- (无)
- 标签
- 递交数
- 274
- 已通过
- 122
- 通过率
- 45%
- 上传者