Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test
- {
- class Program
- {
- static void Main(string[] args)
- {
- int numF = int.Parse(Console.ReadLine());
- if (numF==0 || numF==1)
- {
- Console.WriteLine("1");
- }
- if (numF==2)
- {
- Console.WriteLine("2");
- }
- numRevers(numF);
- }
- static void numRevers(int num)
- {
- int first = 1;
- int sec = 2;
- int sumnum = 1;
- for (int i = 2; i < num; i++)
- {
- sumnum = first + sec;
- Console.WriteLine(sumnum);
- first = sec;
- sec = sumnum;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement