#include <vector>
#include <iostream>
int main()
{
using namespace std;
vector<int> numAry;
vector<int>::iterator pos;
numAry.push_back(1);
for (int i=0;i<10000;i++)
{
for (pos = numAry.begin();pos != numAry.end();pos++)
{
(*pos) *= 3;
if ((*pos)>=100000)
if (pos+1 == numAry.end())
{
int nextNum = (*pos)/100000;
(*pos) %= 100000;
numAry.push_back(nextNum);
break;
}
else
{
*(pos+1) += (*pos)/100000;
(*pos) %= 100000;
}
}
}
for (pos = numAry.begin();pos != numAry.end();pos++)
cout << *pos;
cout << endl;
system("pause");
}
公告版位
星落的瞬間!放棄的後悔是永遠!
- Nov 24 Tue 2009 20:26
印出3的10000次方
全站熱搜
留言列表
發表留言