class Program
{
static void Main(string[] args)
{
for (int iNum = 100; iNum <= 999; iNum++)
{
if (IsdaffodilNumEx(iNum))
{
Console.WriteLine("{0} 是水仙数",iNum);
}
}
Console.ReadKey();
}
public static int GetNumCube(int num)
{
string strNum = Convert.ToString(num);
int result = 0;
for(int i = 0; i < strNum.Length;i++)
{
//ToInt32是将strNum转换成了数字对应的ASCII码
result += GetCube(Convert.ToInt32(strNum));
}
return result;
}