int i,b,s,g; for ( i = 100; i < 1000; i++) { b = i / 100; s = i / 10 % 10; g = i % 10; if (i==b*b*b+s*s*s+g*g*g) { Console.WriteLine("水仙花数是{0}",i); }