[ACM]Q10359: Tiling

[ACM]Q10359: Tiling

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;

namespace Q10359
{
    class Program
    {
        static private int n;static private bool ntof;static private BigInteger[] fib;
        static void Main(string[] args)
        {
            for (; ; )
            {
            labeln: Console.Write("n>>>");
                ntof = int.TryParse(Console.ReadLine(), out n);
                if (!ntof) goto labeln;
                if (n == 0 || n == 1) { Console.WriteLine("Ans={0}", 1); goto labeln; }
                fib = new BigInteger[n];
                fib[0] = 1; fib[1] = 3;
                for (int i = 2; i < n; i++)
                    fib[i] = fib[i - 2] * 2 + fib[i - 1];
                Console.WriteLine("Ans={0}", fib[n - 1]);
            }
        }
    }
}