标题:求完数的解法
只看楼主
sugar
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2007-4-22
 问题点数:0 回复次数:0 
求完数的解法

核心部分:
Dim sum, temp As String
Dim i, j, m As Integer
For i = 1 To 1000
For j = 1 To i \ 2
If i Mod j = 0 Then
m = m + j

If temp = "" Then
temp = j
Else
temp = temp & "+" & CStr(j)
End If
End If
Next
If i = m Then
sum = sum + Str(m) + "=" + temp + Chr(13) + Chr(10)
End If
m = 0
temp = ""
Next
Label2.Text = sum
End Sub

pUWyklKN.rar (245.18 KB) 求完数的解法



[url=http://radio.gdqy.edu.cn]轻院广播台[/url]
搜索更多相关主题的帖子: 解法 
2007-04-30 15:31



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-136247-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.038963 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved