日期:2014-05-18 浏览次数:20883 次
static void Main(string[] args) { int a = 111; int b = 0; int c = 0; for (a = 112; a < 999; a++) { b = a * 2; c = a * 3; if(CheckNumber(a) && CheckNumber(b) && CheckNumber(c)) Console.WriteLine("{0}{1}{2}", a, b, c); } Console.Read(); } private static bool CheckNumber(int number) { if (number.ToString().IndexOf("0") >= 0) return false; int bai = number / 100; int shi = number / 10 % 10; int ge = number % 10; if(bai == shi && shi == ge) return false; if (number >= 999) return false; return true; }