#include<iostream>
using namespace std;
#include<ctime>
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 % 10;
if(num == a*a*a+b*b*b+c*c*c){ //等号意味这赋值,而==意味着等式运算符
cout << num<< endl;
}
num++;
} while (num < 1000);
system("pause");
return 0;
}
P34-循环语句-案例水仙花
最新推荐文章于 2024-08-23 20:19:03 发布