using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace p1
{
class Program
{
static void Main(string[] args)
{
int a=0,b=0,c=0,t=0;
for(int i=100;i<1000;i++)
{
a=i%10;
b=((i-a)/10)%10;
c=((i-(b*10)-a)/100)%10;
t = a * a * a + b * b * b + c * c * c;
if (t == i)
{
Console.WriteLine("所有的水仙花数为:{0}",i);
Console.ReadLine();
}
}
求水仙花数
最新推荐文章于 2023-11-12 19:46:52 发布