C++项目-求水仙花数
求水仙花数
#include <iostream>
using namespace std;int main()
{int n = 100;do {int a = 0;int b = 0;int c = 0;a = n % 10; //个位b = n / 10 % 10; //十位c = n / 100 % 10; //百位if (a * a * a + b * b * b + c * c * c == n) {cout << n << endl;}n++;} while (n < 1000);system("pause");return 0;
}