Advertisement
Guest User

1234

a guest
Nov 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication7
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. int f1 = 1, f2 = 2, 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.  
  24.  
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement