Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace console
- {
- class Program
- {
- static void Main(string[] args)
- {
- WorkingWithStrings();
- Console.WriteLine(Fib(2000));
- }
- static int Fib(int count)
- {
- var nums = new List<int> {1, 1};
- int i = 3;
- while (i++ <= count) {
- var t = nums[nums.Count - 1];
- var p = nums[nums.Count - 2];
- nums.Add(t + p);
- }
- return nums[count - 1];
- }
- static void WorkingWithStrings ()
- {
- var names = new List<string>{"Li lei", "Han meimei", "David"};
- foreach (var name in names) {
- Console.WriteLine($"Hello {name}");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment