fork download
  1. Imports System
  2. Imports System.IO
  3.  
  4. Public Class Suretsu
  5. Shared Sub Main(ByVal args As String())
  6. Dim input As TextReader
  7. input = Console.In
  8.  
  9. Dim line As String = input.ReadLine()
  10.  
  11. While (Not line Is Nothing)
  12. Dim target As Integer = Integer.Parse(line)
  13. dim n as Long = 0
  14. dim r as Long = 1
  15. dim l as Long = 1
  16.  
  17. For i As Integer = 1 To target - 1
  18. 'Console.WriteLine("loop:" & i)
  19. n = n + r
  20. r = l
  21. l = n
  22. Next i
  23.  
  24. Console.WriteLine(n + r + l)
  25.  
  26. line = input.ReadLine()
  27. End While
  28. input.Dispose()
  29. End Sub
  30. End Class
Success #stdin #stdout 0.04s 24248KB
stdin
1
2
3
4
1
stdout
2
3
5
8
2