#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");
}

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 讓地獄深紅的天亮 的頭像
    讓地獄深紅的天亮

    !壞人必需做好事!

    讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣()