読者です 読者をやめる 読者になる 読者になる

Project Euler 25

Problem 25

using System;
using System.Numerics;

class PE025 {
    static void Main() {
        var a = new BigInteger(1);
        var b = new BigInteger(1);
        int nth = 2;
        while (b.ToString().Length < 1000) {
            var t = a + b;
            a = b;
            b = t;
            nth++;
        }
        Console.WriteLine(nth);
    }
}