{
Hashtable hashmap = new Hashtable();
hashmap.Add(0, 0);
hashmap.Add(1, 1);
for (int i =1; ; i++)
{
foreach (DictionaryEntry de in hashmap)
{
int tmp =(int)( Math.Pow(10, i)) +(int)( de.Value);
int tmp2 = tmp % n;
if (tmp2 == 0)
{
return tmp;
}
if(!hashmap.Contains(tmp2 ))
hashmap.Add(tmp2,tmp);
}
}
}
但是没有死循环的退出判断
转载于:https://www.cnblogs.com/pangpangxiong/archive/2009/12/01/1614955.html