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;
for (int i = 100; i < 1000; i++)
{
c = i % 10;
b = (i - c)/10%10;
a = i / 100;
if (i==a*a*a +b*b*b + c*c*c)
{
Console.WriteLine(i);
Console.ReadLine();
}
}
}
}
}
运行结果:
心得体会;解答思路还是和C++一样的。