using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ShuiXianHua
{
//打印水仙花数
class ShuiXianHua_1
{
int i;
int j;
int k;
//int number;
public void checkNum()
{
Console.Write("打印水仙花数(三位数):");
for (int num = 100; num < 1000; num++)
{
i = num / 100; //百位数字
j = num % 100 / 10; //十位数字
k = num % 10; //个位数字
if (i * i * i + j * j * j + k * k * k == num)
Console.Write(":{0,5}", num);
}
Console.WriteLine();
}
}
class Program
{
static void Main(string[] args)
{
ShuiXianHua_1 method1 = new ShuiXianHua_1();
method1.checkNum();
Console.ReadKey();
}
}
}