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

Home > General
Distinct Values Derivation (Posted on 2015-02-15) Difficulty: 3 of 5
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.)
Solution 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

Private Sub Form_Load()
 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
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information