1.vb随机生成10个数(100以内),存入一维数组.完成下列功能:
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/31 12:10:00
privatesubcommand1_click()dima(1to10)asinteger,i,jfori=1to10a(i)=int(rnd*100)+1printa(i);nextprintfo
PrivateSubCommand1_Click()Dima(50),i,nRandomizeFori=1To50a(i)=Int(Rnd*191)+10Printa(i);IfiMod10=0The
'本人亲测可行Private Sub Form_CLICK() Dim arr(9) As In
做完了,不用任何控件,代码如下:DimM(6)AsByte,H(6)AsByteDimG(3)AsByteDimIAsByte,JAsByte,HjAsIntegerConstN=10,X=6,Y=3
帮你写好了,这个是工程文件,下载下来就可以了.以下是源码:PrivateSubCommand1_Click()DimA(10)AsDouble,LAsInteger,BAsDouble,CAsDoub
'在窗体上画两个列表框(ListBox),一个按钮(CommandButton)'粘贴以下代码'单击List1里的范围,在List2里列出该分类的所有数据DimNum(1To10000)AsInteg
dima(9)a(0)=25a(1)=33`````a(9)=99i=int(rnd*10)?a(i)看明白了吗?有问题再HI我再问:输出的三个数要求不重复的呢,你这样的只有一个
Dimk%Dima%(1To10)PrivateSubCommand1_Click()Fori=1To10Randomizea(i)=Int(Rnd*100+1)NextPrint"a数组:"k=1F
PrivateSubCommand1_Click()DimIAsIntegerDimN(15)AsInteger,MAsIntegerRandomizeForI=1To15N(I)=Int(Rnd*1
OptionBase1Dima(20)PrivateSubForm_Load()RandomizeFori=1To10a(i)=Int(10+90*Rnd)NextEndSubPrivateSubCo
privatesubcommand1_click()dima(10)fori=1to10a(i)=int(rnd*90)+10printa(i);s=s+a(i)nextprintprint"总和="
Randomize初始化随机数发生器Rnd()获取0~1之间的随机数,乘以90后再加上10,取整后就是10~90之间的了然后挑选出来Mod3=0的数据排序就是了再问:就是mod3=0后不会排序啊再答:
'声明变量dimMin_numasintdimMax_numasintdimSum_numasintdimArr_num(9)asint'赋予初始值Min_num=101Max_num=-1Sum_n
先建一个大一点的label1框,然后...DimaAsIntegerDimbAsStringDimcAsIntegerDimdAsStringDimeAsIntegerDimfAsIntegerDim
通过SubMain启动Submain()Dima(9)AsInteger,pAsDouble,iAsInteger,nAsIntegerp=0n=0Fori=0To9a(i)=Rnd*100p=p+a
一显示按纽为Button1,文本显示为Txt1.以下为代码:PrivateSubButton1_Click(ByValsenderAsSystem.Object,ByValeAsSystem.Even
'在窗体上点击PrivateSubForm_Click()DimI,JAsIntegerDima(7),B(7)AsIntegerRandomizea(0)=Int(Rnd()*10)ForI=1To
privatesubcommand1_click()randomizedimaasinteger,basinteger,casintegera=int(rnd*12)+1text1=adob=int(
添加两个控件名字分别为sc、tj的按钮.'定义一个窗体数组变量dima(10)asinteger'生成是个随机数privatesubsc_click()'下面这一句可以得到不同的随机数randomiz
Dima(10)AsIntegerDimi%,j%,t%RandomizFori=1To10a(i)=Int(Rnd*90+10)Printa(i);NextPrintFori=1To9Forj=i+