摘要:
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 阅读全文
摘要:
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] = 阅读全文
摘要:
public static int Fibonacci(int aVal) { if (aVal == 0) { return 0; } if (aVal <= 2) { return 1; } else return Fibonacci(aVal - 1) + Fibonacci(aVal - 2); } 阅读全文