Advertisement
Guest User

Untitled

a guest
May 25th, 2016
527
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. class Fibonacci
  8. {
  9. static void Main(string[] args)
  10. {
  11. int n = int.Parse(Console.ReadLine());
  12. int first = 1;
  13. int second = 1;
  14. for (int i = 0; i < n - 1; i++)
  15. {
  16. int third = first + second;
  17. first = second;
  18. second = third;
  19. }
  20. Console.WriteLine(second);
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement