- using ConsoleApp1;
- using System;//程式庫呼叫
- using System.ComponentModel.DataAnnotations;
- using System.Linq.Expressions;
- using ABC.qq;
- class Program//負責一部分工作的人
- {
-
- static void Main()
- {
- try
- {
- long[] fs = new long[50];
- fs[0] = 0;
- fs[1] = 1;
- for(int i=2;i<fs.Length;i++)
- {
- fs[i]= fs[i - 1] + fs[i - 2];
- }
- int index=Convert.ToInt32(Console.ReadLine());
- Console.WriteLine("{0}:{1}", (index + 1), fs[index]);
- }catch
- {
- Console.WriteLine("error");
- }
- Console.ReadKey();
- }
-
- }
複製代碼 |