public A37Page() {Console.WriteLine("1000以内的完数为:");for (int i = 2; i <= 10000; i++){string str = "1";//用于存放完数的各个因子int s = 1; //用于存放各因子之和int a = 0;for (int j = 2; j <= (int)Math.Sqrt(i); j++){if (i % j == 0 && i != j){a = i / j; //用于存放满足条件两数之商s += j + a;//存放因子之和str += string.Format("+{0}+{1}", j, a);}}if (s == i)//完数判断{Console.WriteLine("结果显示:{0} = {1}", i, str);}}}