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

Home > Numbers
funny numbers (Posted on 2004-07-28) Difficulty: 1 of 5
X and Y are positive integers, neither of which is divisible by 10. Their product is 100,000.

What is X + Y ?

See The Solution Submitted by Thalamus    
Rating: 2.3636 (11 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
VB, or not VB ? That is the question.... | Comment 10 of 19 |

Visual Basic !! This one was easy even for me.

Imports System
Imports System.IO
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Math
Module Module1
    Sub Main()
        Randomize()
        Dim strstarttime As String
        Dim strendtime As String
        Dim strend As String
        Dim dblwork as double
        strstarttime = TimeOfDay
        Console.WriteLine("Start of execution: " & strstarttime)
        For indexa As Integer = 1 To 100000
            If indexa Mod 10 <> 0 Then
                dblwork = 100000 / indexa
                If dblwork = Fix(100000 / indexa) Then
                    If dblwork Mod 10 <> 0 Then
                        Console.WriteLine( _
                        "X=" & Str(indexa) & _
                        " Y=" & Str(dblwork) & _
                        " X+Y=" & _
                        Str(indexa + dblwork))
                    End If
                End If
            End If
        Next
        strendtime = TimeOfDay
        Console.WriteLine(" ")
        Console.WriteLine("Start of execution: " & strstarttime)
        strendtime = TimeOfDay
        Console.WriteLine("End of execution: " & strendtime)
        strend = "?"
        Console.WriteLine(" ")
        While strend <> "X"
            Console.WriteLine("Please enter X to exit program...")
            strend = UCase(Console.ReadLine())
        End While
    End Sub
End Module

 

 

Edited on July 28, 2004, 3:26 pm
  Posted by Penny on 2004-07-28 15:22:56

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 (3)
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