【发布时间】:2016-04-13 14:46:59
【问题描述】:
List<int> pal=new List<int>();
List<int> nums = new List<int>();
var thdigit1 = 1;
var thdigit2 = 999;
while (thdigit2>=1)
{
var holder=thdigit1* thdigit2;
nums.Add(holder);
thdigit2 -= 1;
if (thdigit2==0)
{
thdigit2 = 999;
thdigit1 += 1;
}
}
我在列表中遇到了太多的内存过载问题。我的计算机可以处理一定的限制吗?谢谢
【问题讨论】:
-
由于您的计算机可能不是无限机器:是的,肯定有一定的限制。但是您的代码中可能存在问题。见伊恩的回答。
-
连同参考下面的答案请阅读stackoverflow.com/help/how-to-ask
-
所以我相信这个问题列表应该包含 999^2 个整数,是不是太多了?
-
请不要提供自定义错误描述 - 提供编译器/运行时报告的准确错误。