返回列表 發帖
  1. using ConsoleApp1;
  2. using System;//程式庫呼叫
  3. using System.ComponentModel.DataAnnotations;
  4. using System.Linq.Expressions;
  5. using ABC.qq;


  6. class Program//負責一部分工作的人
  7. {
  8.    
  9.     static void Main()
  10.     {
  11.         try
  12.         {
  13.             long[] fs = new long[50];
  14.             fs[0] = 0;
  15.             fs[1] = 1;
  16.             for(int i=2;i<fs.Length;i++)
  17.             {
  18.                 fs[i]= fs[i - 1] + fs[i - 2];
  19.             }
  20.             int index=Convert.ToInt32(Console.ReadLine());
  21.             Console.WriteLine("{0}:{1}", (index + 1), fs[index]);

  22.         }catch
  23.         {
  24.             Console.WriteLine("error");
  25.         }
  26.         Console.ReadKey();
  27.     }
  28.    
  29. }
複製代碼
istak.teach2@gmail.com

TOP

返回列表