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 test
- {
- class Program
- {
- static void Main(string[] args)
- {
- int f0 = 0;
- int f1 = 1;
- int fN = 0;
- int n = int.Parse(Console.ReadLine());
- do
- {
- fN = f0 + f1;
- f0 = f1;
- f1 = fN;
- ;
- n--;
- }
- while (n > 0);
- Console.WriteLine(f1);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment