All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Distinct Values Derivation (Posted on 2015-02-15)
Express a given date in 2015 in the MM/DD/YY format.

Determine the total number of distinct values of MM*DD in the year 2015.

 No Solution Yet Submitted by K Sengupta No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 1 of 2
DefDbl A-Z
Dim v(372), crlf\$
Function mform\$(x, t\$)
a\$ = Format\$(x, t\$)
If Len(a\$) < Len(t\$) Then a\$ = Space\$(Len(t\$) - Len(a\$)) & a\$
mform\$ = a\$
End Function

ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf\$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents

For m = 1 To 12
For d = 1 To 31
v(m * d) = 1
Next
Next

For i = 1 To 372
If v(i) Then ct = ct + 1
Next

Text1.Text = Text1.Text & ct

Text1.Text = Text1.Text & " done"
End Sub

finds 184

 Posted by Charlie on 2015-02-15 14:18:04

 Search: Search body:
Forums (0)