更多"下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请在横线处将程"的相关试题:
[填空题]下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请在横线处将程序补充完整。
public class Sun
public static void main(String args[])
int[]a=678,45,324,528,439,387,87,875,273,823;
int a1=0;
for(int i=0; i<=8;i++)
for(int j=______;j<=9;i++)
if(a[i]>=a[j])
al=a[j];
a[j]=a[i];
a[i]=al;
for(int i=0;i<=9;i++)
System.out.println(a[i]);
[填空题]下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请在横线处将程序补充完整。
public class Sun
public static void main(String args[])
int[] a=678,45,324,528,439,387,87,875,273,823 ;
int a1=0;
for(int i=0; i<=8;i++)
for(int j= 【12】 ;j<=9;j++)
if(a[i]>=a[j])
a1=a[j];
a[j]=a[i];
a[i]=a1;
for(int i=0;i<=9;i++)
System. out. println(a[i]);
[填空题]下面程序是用冒泡法将数组a中的10个整数按升序排列,请将程序补充完整。
Private Sub Command1_Click( )
Dim a, Tmp As Integer
a = Array (678,45,324,528,439,387,87,875,273,823)
For i = 【12】
Forj =0 To 9
Ifa (i)<a(j) Then
Tmp = a(i): a(i) = a(j) i a(j) = Tmp
End If
Next j,i
For i = 0 To 9
Print a(i)
Next
End Sub
[填空题]下面的程序是用冒泡法将数组a中的10个整数按升序排列,并将程序补充完整。
Private Sub Command1_Click( )
Dim a
Dim Tmp As Integer
a=Array(678 , 45 , 324 , 528 , 439 , 387 , 87 , 875 , 273 , 823)
For i=______
For j=______
If a(i)______a(j)Then
Tmp=a(i)
a(i)=a(j)
a(j)=Tmp
End If
Next j
Next i
For i=0 To 9
Print a(i)
Next i
End Sub
[填空题]下面的程序用冒泡法将数组a中的10个整数按升序排列,请在三处将程序补充完整。
Option Base 1
Private Sub Command1_Click( )
Dim a
a=Array(678,45,324,528,439,387,87,875,273,823)
For i=______
For j=______
If a(i)______a(j)Then
a1=a(i)
a(i)=a(j)
a(j)=a1
End If
Next j
Next i
For i=1 To 10
Print a(i)
Next i
End Sub
[填空题]下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请将程序补充完整。
Option Base 1
Private Sub Command1_Click( )
Dim a
a=Array(678,45,324,528,439,387,87,875,273,823)
For i= 【8】
For j= 【9】
If a(i) 【10】 a(j)Then
a1=a(i)
a(i)=a(j)
a(j)=a1
End If
Next j
Next i
For i=1 To 10
Print a(i)
Next i
End Sub
[填空题]下面的程序用“冒泡”法将数组a中的10个整数按升序排列,请将程序补充完整。
Option Base 1
Private Sub Command1_Click( )
Dim a
a = Array(549, 45, 324, 561, 439, 258, 87, 435, 587, 823)
For i = 【5】
For j = 【6】
If a(i) 【7】 a(j) Then
al = a(i)
a(i) = a(j)
a(j) = al
End If
Next j
Next i
For i = 1 To 10
Print a(i)
Next i
End Sub
[填空题]下面是用冒泡法将5个整数按升序排列,请将程序补充完整。
Sub GASR( )
Dim m
m=Array(10,1,5,6,7)
For i=0 To 3
For j=【 】
If m(i) >=m(j) Then
【 】
m(i) =m(j)
m(j) =t
End If
Next j
【 】
For i=0 To 4
Print m(i)
Next i
End Sub