摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleUtilities{ class AcceptMutilLine { static string acceptmultiLine() { ConsoleKeyInfo cki; Console.TreatControlCAsInput = true;//防止Ctrl+C复制 Console.WriteLine("Press the F10 key to quit: \n"); s 阅读全文
posted @ 2012-03-21 16:56 沙耶 阅读(536) 评论(0) 推荐(0) 编辑
摘要: public int FibonacciSum(int aVal) { int sum = 0; if (aVal == 0) { return 0; } if (aVal == 1) { return sum = 1; } else if (aVal == 2) { return sum = 2; } else { int[] Fibo = new int[aVal]; for (int i = 0; i < aVal; i++) { Fibo[0] = 1; Fibo[1] = 1; for (int j = 3; j <= aVal; j++) { Fibo[j - 1] = 阅读全文
posted @ 2012-03-21 16:55 沙耶 阅读(3116) 评论(0) 推荐(0) 编辑
摘要: public static int Fibonacci(int aVal) { if (aVal == 0) { return 0; } if (aVal <= 2) { return 1; } else return Fibonacci(aVal - 1) + Fibonacci(aVal - 2); } 阅读全文
posted @ 2012-03-21 16:54 沙耶 阅读(200) 评论(0) 推荐(0) 编辑