solution.cpp 428 字节
Newer Older
每日一练社区's avatar
每日一练社区 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <iostream>
using namespace std;

typedef long long LL;

void div(LL a, LL b, int end, int begin) //模拟手工除法
{
    if (begin > end)
        return;
    int tmpans = a / b;
    cout << tmpans;
    div((a % b) * 10, b, end, begin + 1);
}

int main()
{
    unsigned long long f[500] = {0, 1};

    for (int i = 2; i < 100; i++)
        f[i] = f[i - 1] + f[i - 2];

    div(f[48], f[49], 100, 0);

    return 0;
}