Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Fibonacci
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int first = 1;
- int second = 1;
- for (int i = 0; i < n - 1; i++)
- {
- int next = first + second;
- first = second;
- second = next; //изместваме ги с 1 настрани
- }
- Console.WriteLine(second);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment