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;
- namespace ConsoleApplication7
- {
- class Program
- {
- static void Main(string[] args)
- {
- int f1 = 1, f2 = 2, n, aux = 0;
- n = Convert.ToInt32(Console.ReadLine());
- for (int i = 2; i <= n; i++)
- {
- aux = f1 + f2;
- f1 = f2;
- f2 = aux;
- }
- Console.WriteLine(aux);
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement