两个合数是素数,它们的最小公倍数是260,求两个数.
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/11 15:46:49
两个合数是素数,它们的最小公倍数是260,求两个数.
楼上说错了
20+13=33不是素数啊,不满足楼主说的条件
不过我用VB模拟了一下,就诶过仍然算不出楼主的谜底.
话说真的有这样的数字吗?是不是楼主条件错了?
下面是我的代码:
Option Base 1
Dim counter As Long
Dim a() As Long
Private Sub Command1_Click()
Dim x As Long
Dim y As Long
counter = 0
For var = 1 To 260
got var
Next var
Print counter
For x = 1 To counter
For y = 1 To counter
If a(x) > a(y) Then
If a(x) * a(y) / 260 = MOD_(a(x),a(y)) Then
Text1.Text = Text1.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
If pan(a(x) + a(y)) Then
Text2.Text = Text2.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
End If
End If
Else
If a(x) * a(y) / 260 = MOD_(a(y),a(x)) Then
Text1.Text = Text1.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
If pan(a(x) + a(y)) Then
Text2.Text = Text2.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
End If
End If
End If
Next y
Next x
End Sub
Function MOD_(ByVal x As Long,ByVal y As Long) As Long
Do
t = x Mod y
x = y
y = t
Loop While t 0
MOD_ = x
End Function
Private Sub got(ByVal var As Long)
flag = 0
For i = 2 To Int(Sqr(var))
If var Mod i = 0 Then
flag = flag + 1
End If
Next i
If flag > 0 Then
counter = counter + 1
ReDim Preserve a(counter)
a(counter) = var
End If
End Sub
Function pan(ByVal var As Long) As Boolean
flag = 0
For i = 2 To Int(Sqr(var))
If var Mod i = 0 Then
flag = flag + 1
End If
Next i
If flag = 0 Then
pan = True
Else
pan = False
End If
End Function
代码是没有错误的,我已经试验很多次了.
如果我错了,烦请楼主知道答案时告诉我一声.
20+13=33不是素数啊,不满足楼主说的条件
不过我用VB模拟了一下,就诶过仍然算不出楼主的谜底.
话说真的有这样的数字吗?是不是楼主条件错了?
下面是我的代码:
Option Base 1
Dim counter As Long
Dim a() As Long
Private Sub Command1_Click()
Dim x As Long
Dim y As Long
counter = 0
For var = 1 To 260
got var
Next var
Print counter
For x = 1 To counter
For y = 1 To counter
If a(x) > a(y) Then
If a(x) * a(y) / 260 = MOD_(a(x),a(y)) Then
Text1.Text = Text1.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
If pan(a(x) + a(y)) Then
Text2.Text = Text2.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
End If
End If
Else
If a(x) * a(y) / 260 = MOD_(a(y),a(x)) Then
Text1.Text = Text1.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
If pan(a(x) + a(y)) Then
Text2.Text = Text2.Text & a(x) & "—" & a(y) & Chr(13) & Chr(10)
End If
End If
End If
Next y
Next x
End Sub
Function MOD_(ByVal x As Long,ByVal y As Long) As Long
Do
t = x Mod y
x = y
y = t
Loop While t 0
MOD_ = x
End Function
Private Sub got(ByVal var As Long)
flag = 0
For i = 2 To Int(Sqr(var))
If var Mod i = 0 Then
flag = flag + 1
End If
Next i
If flag > 0 Then
counter = counter + 1
ReDim Preserve a(counter)
a(counter) = var
End If
End Sub
Function pan(ByVal var As Long) As Boolean
flag = 0
For i = 2 To Int(Sqr(var))
If var Mod i = 0 Then
flag = flag + 1
End If
Next i
If flag = 0 Then
pan = True
Else
pan = False
End If
End Function
代码是没有错误的,我已经试验很多次了.
如果我错了,烦请楼主知道答案时告诉我一声.
两个合数是素数,它们的最小公倍数是260,求两个数.
两个合数是互素数,它们的最小公倍数是260,求这两个数.
两个合数是互素数,且它们的最小公倍数是36,则这两个数的和是
一个合数和一个素数的最小公倍数是36,则这两个数分别是
两个不同的素数,它们的最小公倍数是77,这两个数分别是()和()
两个数都是合数有是互质数,而且它们的最小公倍数是120,这两个数是什么
互质的两个合数,它们的最小公倍数是702,这两个数是()和()
写出两个合数,使它们的最小公倍数是这两个数的乘积
1.如果一个素数与一个合数不是互素数,那么这个合数是这两个数的最小公倍数,这句话对吗?2.正整数中只
两个合数是互素数,他们最小公倍数是420,这样的两个数有几对
两个数都是素数这两个数最小公倍数是35这两个数是.两个数都是合数最大公因数是2这两个数最小是
差是一的两个素数是几和几,它们都最小公倍数数几