Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int f1 = 1, f2 = 1, n, aux = 0;
  13. n = Convert.ToInt32(Console.ReadLine());
  14. for (int i = 2; i <= n; i++)
  15. {
  16. aux = f1 + f2;
  17. f1=f2;
  18. f2 = aux;
  19. }
  20. Console.WriteLine(aux);
  21. Console.ReadLine(); }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement