Advertisement
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;
- class Fibonacci
- {
- 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 third = first + second;
- first = second;
- second = third;
- }
- Console.WriteLine(second);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement