更多"以下程序段的作用是首先按降序输入10个数到数组Y的前10个元素中,又输"的相关试题:
[填空题]以下程序段的作用是首先按降序输入10个数到数组Y的前10个元素中,又输入一个YO插入到数组Y中,插入YO后Y中的数据仍按降序排列。请补充完该程序______。
Dim Y(1 To 11)
For i =1 To 10
Y(i) = Val(InputBox(“请输入Y(i):”))
Next i
X = Val(InputBox (“请输入x:”))
For i = 10 To 1 Step -1
If 【8】 Then
Y(i + 1) = X
Exit For
End If
Y (i + 1) =Y(i)
Next i
’Print Y(10)
For i =1 To 11
Print Y(i)
Next I
[填空题]以下程序段的作用是 【14】 。
STR1 DB 300DUP ( )
STR2 DB 100DUP ( )
MOV CX,100
MOV BX,200
MOV S1,0
NEXT: MOV AL,STR1[BX][S1]
MOV STR2[D1],AL
INC SI
INC DI
LOOP NEXT
[填空题]以下程序段的作用是计算数据的和,数据的个数是可变的。请填空。
Private Sub Command1_Click( )
Dim a As Integer
a=0
Sum a, 1, 5, 2
Print "sum of 3 = "; a
a = 0
Call Sum(a, 1, 3, 5, 7, 9)
Print "sum of 5 = "; a
End Sub
Private Sub Sum(x As integer, 【3】
Dim y As Variant
For 【4】
x = x + y
Next y
End Sub
[填空题]以下程序段的作用是计算数据的和,数据的个数是可变的。请填空。
Private Sub Command1_Click( )
Dim a As Integer
a=0
Sum a, 1, 5, 2
Print "sum of 3 = "; a
a = 0
Call Sum(a, 1, 3, 5, 7, 9)
Print "sum of 5 = "; a
End Sub
Private Sub Sum(x As integer, 【3】
Dim y As Variant
For 【4】
x = x + y
Next y
End Sub
[填空题]以下程序段的作用是将STR1的后 【4】 个数据传送到STR2中。
STR1 DB 300 DUP( )
STR2 DB 100 DUP( )
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT:MOV AL,STRl1[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[填空题]以下程序段的作用是将STR1的后 【4】 个数据传送到STR2中。
STR1 DB 300 DUP( )
STR2 DB 100 DUP( )
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT:MOV AL,STRl1[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[填空题]以下程序段的作用是将STR1的后______个数据传送到STR2中。
STRl DB 300 DUP( )
STR2 DB 100 DUP( )
…
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT: MOV AL,STRl[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[填空题]以下程序段的作用是将STR1的后______个数据传送到STR2中。
STR1 DB 300 DUP( )
STR2 DB 100 DUP( )
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT:MOV AL,STR1[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[填空题]以下程序段的作用是将STR1的后______个数据传送到STR2中。
STR1 DB 300 DUP( )
STR2 DB 100 DUP( )
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT:MOV AL,STR1[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[填空题]下面程序段的作用是从文本框中输入数据,如果该数据满足条件:除以6余2,除以5余3,则输出,否则,将焦点定位在文本框中,并清除文本框的内容。请填空。
Private Sub Command1_Click( )
num=Val(Text1.Text)
If ______ Then
Print num
Else
Text1. Text=""
______
End If
End Sub
[填空题]以下程序段的作用是将STR1的后______个数据传送到STR2中。
STR1 DB 300 DUP( )
STR2 DB 100 DUP( )
MOV CX,100
MOV BX,200
MOV SL,0
MOV DI,0
NEXT:MOV AL,STRl1[BX][SI]
MOV STR2[DI],AL
INC SI
INC DI
LOOP NEXT
[简答题]【说明】
以下程序实现数据的排序,将n个整数分别按照升序和降序进行排序,类SortInt_1实现升序排序,类SortInt_2实现降序排序。
【Java代码】
class SortInt_1{
int i,i,k,temp;
void SortInt(int a1,int a2[]){//升序排序
for(i=0;i<a1-1;i++){
k=i;
for(j=i+1;j<a1;j++){
if( (1) ) k=j;
if(k !=i){
temp=a2[i];a2[i]=a2[k];a2[k]=temp;
}
}
}
}
}
class SortInt_2 (2) {
int i,j,k,temp;
void SortInt(int a1, int a2[]){//降序排序
for(i=0; i<a1-1;i++){
k=i;
for(j=i+1;j<a1;j++){
if( (3) )k=j;
}
if(k !=i){
temp=a2[i];a2[i]=a2[k];a2[k]=temp;
}
}
}
}
public class test{
public static void main(String args[]){
int a[]={10,55,100,35,87,90,100,16};
SortInt_1 NewInt= (4) ;
NewInt.SortInt(a.lenvh,a);//调用SortInt_1类的方法
System.out.println("升序排列的数据: ");
for(int i=0;i<a.length;i++){
System.out.print(a[i]+
[多项选择]【说明】
以下程序实现数据的排序,将n个整数分别按照升序和降序进行排序,类SortInt_1实现升序排序,类SortInt_2实现降序排序。
【Java代码】
class SortInt_1
int i,i,k,temp;
void SortInt(int a1,int a2[])//升序排序
for(i=0;i<a1-1;i++)
k=i;
for(j=i+1;j<a1;j++)
if( (1) ) k=j;
if(k !=i)
temp=a2[i];a2[i]=a2[k];a2[k]=temp;
class SortInt_2 (2)
int i,j,k,temp;
void SortInt(int a1, int a2[])//降序排序
for(i=0; i<a1-1;i++)
k=i;
for(j=i+1;j<a1;j++)
if( (3) )k=j;
if(k !=i)
temp=a2[i];a2[i]=a2[k];a2[k]=temp;
public class test
public static void main(String args[])
int a[]=10,55,100,35,87,90,100,16;
SortInt_1 NewInt= (4) ;
NewInt.SortInt(a.lenvh,a);//调用SortInt_1类的方法
System.out.prin
[填空题]下列程序段的作用是控制窗体的显示与隐藏。请填空。
Private Sub Form_Click( )
Dim msg As Integer
Me. 【5】
MsgBox "单击Ok显示窗体"
Form1. 【6】
End Sub