Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Selected Poems of Rumi Dover Thrift Edition...day#doy~Poem#n
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
'Rextester.Program.Main is the entry point for your code. Don't change it. 'Compiler version 11.0.50709.17929 for Microsoft (R) .NET Framework 4.5 Imports System : Imports System.Collections.Generic : Imports System.Linq : Imports System.Text.RegularExpressions Namespace Rextester Public Module Program 'https://www.programmingalgorithms.com/algorithm/day-of-year?lang=VB.Net Public Function DayOfYear(year As UInteger, month As Byte, day As Byte) As Integer Dim days As UShort() = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334} If IsLeapYear(year) AndAlso month >= 2 Then Return days(month - 1) + day + 1 End If Return days(month - 1) + day End Function Private Function IsLeapYear(year As UInteger) As Boolean Return (year Mod 4 = 0 AndAlso (year Mod 100 <> 0 OrElse year Mod 400 = 0)) End Function Public Sub Main(args() As string) 'Your code goes here Dim doy = DayOfYear(CUInt(DateTime.Now.Year), CByte(DateTime.Now.Month), CByte(DateTime.Now.Day)) Console.WriteLine(CUInt(DateTime.Now.Year) & "-" & _ CStr(DateTime.Now.Month+100).Substring(1,2) & "-" & _ CStr(DateTime.Now.Day+100).Substring(1,2) & " " & _ CStr(DateTime.Now.Hour+100).Substring(1,2) & ":" & _ CStr(DateTime.Now.Minute+100).Substring(1,2)) Console.WriteLine("Selected Poems of Rumi Dover Thrift Edition...day#" & doy &"~Poem#" & (doy mod 119)+1) End Sub End Module End Namespace
Show compiler warnings
[
+
]
Show input
Compilation time: 0,25 sec, absolute running time: 0,14 sec, cpu time: 0,11 sec, average memory usage: 17 Mb, average nr of threads: 4
edit mode
|
history
|
discussion
2018-09-03 08:02 Selected Poetry of Rumi ...day#246~Poem#9