X and
Y are positive integers, neither of which is divisible by 10. Their product is 100,000.
What is X + Y ?
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 |