全文预览

郑州大学VB模拟题5

上传者:科技星球 |  格式:docx  |  页数:13 |  大小:0KB

文档介绍
Rnd * 90) + 10РPrint a(i);РNext i: PrintРmin = a(1): max = min РFor i = 2 To РIf a(i) > max Then max = a(i) РIf a(i) < min Then min = a(i) РNext iРPrint "最大值为"; maxРPrint "最小值为"; minРEnd SubР(4分)Р4、* 杨辉三角形如图所示{<x_5.jpg>}:Р* 完成下面程序。РPrivate Sub Form_Click()РDim a(1 To 10, 1 To 10) As Integer, i%, j%РFor i = 1 To 10Рa(i, 1) = 1Рa(i, ) = 1РNext iРFor i = 3 To 10РFor j = 2 To i - 1Рa(i, j) = a(i - 1, j - 1) + a(i - 1, j)РNext jРNext iРFor i = 1 To 10РFor j = 1 To РPrint Tab(5 * (j - 1) + 1); a(i, j);РNext jРPrintРNext iРEnd SubР【附图3】(4分)Р5、* 利用判断一个三位数是否为对称数(如:343)的函数过程,求出所有三位对称数之和。Р* 程序代码如下:РPrivate mand1_Click()РDim sum As Long,n As IntegerРsum=0РFor n = 100 To 999РIf duicheng(n) then sum=sum+РNext nРEnd Sub РPublic Function duicheng(ByVal i%) As BooleanРa = i Mod 10Рc = i \ 100РIf a = c Then

收藏

分享

举报
下载此文档