利用随机函数产生10个两位数存入数组a中,然后进行从大到小排序并输出排序结果
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/07 22:46:28
a1:a10=randbetween(30,100)最大值=max(a1:a10)最小值=min(a1:a10)平均值=average(a1:a10)
PrivateSubCommand1_Click()RandomizeDima(10)AsInteger,imasasinteger,iminasinteger,Averageasintegerima
command1完成第一题,command2完成第二题PrivateSubCommand1_Click()Dimx%(1To10),n%,i%n=1DoWhilen
PrivateSubCommand1_Click()Dimi,max,min,sAsIntegermax=0min=100s=0Dima(30)AsIntegerText1.Text=""Text2.
zd=Int(Rnd()*51)+50zx=Int(Rnd()*51)+50Fori=1To19xd=Int(Rnd()*51)+50Ifxd>zdThenzd=xdIfxdNextiPrintzd,
s=0p=50q=100Fori=1To20a=Int(Rnd*51+50)Printa;ifa>=pthenp=aendififa
PrivateSubCommand1_Click()Dima%(1To20),max%,min%max=50min=100RandomizeClsFori=1To20a(i)=Int(Rnd*51+5
我已经上机验证过了,正确.思路:产生80个随机数,把这80个随机数由小到大排序,然后从第1个到第80个的顺序挑选偶数,赋值给字符串s1,够10个换行.再从第80个到第1个的顺序挑选奇数,赋值给字符串s
Dima%(1To6,1To6),b%(1To6,1To6)PrivateSubCommand1_Click()Fori=1To5Forj=1To5a(i,j)=Int(Rnd*90+10)Pictu
Java源程序:importjava.util.Random;publicclassTest21{\x05publicstaticvoidmain(String[]args){\x05\x05int[
#includevoidmain(){inta[100],i;for(i=0;i
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccc
PrivateSubCommand1_Click()Dima(100)AsInteger,xAsIntegerFori=1To100Ifsushu(i)ThenPrinti;IfiMod10=0The
源代码已发.278700294@qq.com
第一题:Optionbase1PrivateSubForm_Click()Dima(4,5)asinteger,iasinteger,jasinteger,sasintegerdima_aveassi
PrivateSubCommand1_Click()Dima(29)AsInteger,tmpAsIntegerDimiAsInteger,jAsIntegerRandomizeTimeFori=0T
dima(30)fori=1to30a(i)=int(rnd(97+3))ifisprime(a(i))=truethenprinta(i);nextifunctionisprime(xasinteg
inta[]={2,5,22,666,33,234,6,7,88,55};intc;//for(inti=0;i
#include <stdlib.h>#include <time.h>#include <stdio.h>void mai