using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int a, b, c, num;
for (num = 100; num < 1000; num++)
{
a = num % 10;
b = (num - a)/10 % 10;
c = num / 100;
if (num == a * a * a + b * b * b + c * c * c)
{
Console.WriteLine(num);
Console.ReadLine();
}
}
}
}
}
心得体会:
运行结果: