早教吧作业答案频道 -->其他-->
删除一个数列中的重复数OptionExplicitOptionBase1DimA()AsInteger'定义了一个模块级的动态数组PrivateSubCommand1Click()DimNAsInteger,IAsIntegerText1=""Text2=""N=Inpu
题目详情
删除一个数列中的重复数
Option Explicit
Option Base 1
Dim A() As Integer '定义了一个模块级的动态数组
Private Sub Command1_Click()
Dim N As Integer, I As Integer
Text1 = ""
Text2 = ""
N = InputBox("输入N")
ReDim A(N)
Randomize
For I = 1 To N
A(I) = Int(10 * Rnd) + 1
Text1 = Text1 & Str(A(I))
Next
End Sub
Private Sub CmdErase_Click()
Dim Ub As Integer, I As Integer, J As Integer
Dim K As Integer, N As Integer
Text2 = ""
Ub = UBound(A)
N = 1
Do While N < Ub
I = N + 1
Do While I
Option Explicit
Option Base 1
Dim A() As Integer '定义了一个模块级的动态数组
Private Sub Command1_Click()
Dim N As Integer, I As Integer
Text1 = ""
Text2 = ""
N = InputBox("输入N")
ReDim A(N)
Randomize
For I = 1 To N
A(I) = Int(10 * Rnd) + 1
Text1 = Text1 & Str(A(I))
Next
End Sub
Private Sub CmdErase_Click()
Dim Ub As Integer, I As Integer, J As Integer
Dim K As Integer, N As Integer
Text2 = ""
Ub = UBound(A)
N = 1
Do While N < Ub
I = N + 1
Do While I
▼优质解答
答案和解析
2个子程序中的n不相干,都是局部变量,退出各自的子程序后n都会清0
看了 删除一个数列中的重复数Opt...的网友还看了以下:
选出与所给单词划线部分读音相同的一项1、h(o)meA.c(o)meB.g(o)C.d(o)cto 2020-05-17 …
如图在平面直角坐标系中,直线y=-3x/4+b分别与x轴,y轴交于点A,B,且点A的坐标为(8,0 2020-06-14 …
选出下面各项中字音有误的一项:A剥皮bāo剥夺bō褒贬bāo薄饼báoB薄情bó冰雹báo一曝十寒 2020-07-01 …
下列各项,注音有误的一项是()A.ān谙习àn黯然àng盎然ái白雪皑皑B.ài狭隘āo凹陷báo 2020-07-06 …
英语高手傍忙拼几个单词!X,I,A,O,F,E,I,W,O,A,I,N,I打头的 2020-07-13 …
数据结构的问题6.程序段For(i=n-1;i>0;i--)For(j=1;ja[j+1])a[j] 2020-10-30 …
有n个站点,每个站点发生某个事件的概率是p,那么发生事件总数为i的概率是b(i;n,p),b(i;n 2020-11-22 …
程序段for(i=n-1;i>=0;i--)for(j=1;jA[j+1]A[j]与A[j+1]对换 2020-11-26 …
读一读,填一填。天上的()飘呀飘,()公公眯眯笑,树上的()喳喳叫,地上的()在吃草,()们上学校, 2020-12-09 …
英语向高人求教!写几句话.每句开头的第一个字母分别是“L,i,U,F,E,i,F,E,i,w,o,a 2020-12-15 …