1. 程序功能:把一张百元钞票,换成一元、二元和五钞票,每种至少5张,求对换方案数。2 05 Private Sub command1_click() For x = 5 To 100 For y = 5 To 50 For z = 5 To 20 If x + 2 * y + 5 * z = 100 Then n = n + 1 End If Next z, y, x Print n End Sub 2. 编写程序,计算在[10,200]的范围内有多少个数,其每位数的乘积大于每位数的和。 124 Private Sub command1_click() For i = 10 To 200 Select Case i Case 10 To 99 g = i Mod 10 s = i \ 10 Mod 10 If g * s > g + s Then n = n + 1 Case 100 To 200 g = i Mod 10 s = i \ 10 Mod 10 b = i \ 100 Mod 10 If g * s * b > g + s + b Then n = n + 1 End
2022-06-20 18:04:44
51KB
文档资料