请完成Java程序:本题是一个冒泡排序程序的实例。冒泡排序的含义是将相邻的两个数作比

题型:问答题

问题:

请完成Java程序:本题是一个冒泡排序程序的实例。冒泡排序的含义是将相邻的两个数作比较,如果是升序排列的话,如果前边的数大,则将两个数交换。从第一个数开始两两比较一次,就可以将最大的数移动到最后。 注意:请勿修改main()主方法和其他已有语句内容,仅在横线处填入适当语句。 import java.io.*; public class simple { public static int[]Data=new int[10]; public static void main(String[] args)int i;int Index;Index=0;InputStreamReader ir;BufferedReader in;ir=new InputStreamReader(System.in);in=new BufferedReader(ir);try{ do { System.out.println("Please input the number"+ Index+"you want to sort(Exit for 0):"); String s=in.readLine(); Data[Index]=Integer.parseInt(s); Index++; } while(Data[Index-1]!=0);}catch(IOException e){ System.out.println(e.getMessage());}System.out.print("Before bubble sorting:");for(i=0; i<Index-1; i++) System.out.print(" "+Data[i]+" "); System.out.println(" "); BubbleSort(Index-1); System.out.print("After Bubble Sorting:");for(i=0; i<Index-1;i++) System.out.print(" "+Data[i]+" "); System.out.println(" "); } public static void BubbleSort(int Index) {int i, j, k;boolean Change;int Temp;for(j=Index; j>1;j--){ Change=false; for(i=0; i<j-1;i++) { if(Data[i+1]<Data[i]) { Temp=Data[i+1]; Data[i+1]=Data[i]; ______; ______; } } if(Change) { System.out.print("Current Sorting Result:"); for(k=0; k<Index; k++) System.out.print(" "+Data[k]+" "); System.out.println(" "); }} } }

考点:计算机等级考试JAVA二级JAVA机试65
题型:问答题
已知a、b、c是互不相等的非零实数.若用反证法证明三个方程ax2+2bx+c=0,bx2+2cx+a=0,cx2+2ax+b=0至少有一个方程有两个相异实根,应假设成(   )
A.三个方程都没有两个相异实根B.一个方程没有两个相异实根
C.至多两个方程没有两个相异实根D.三个方程不都没有两个相异实根
题型:问答题

按照1986年国务院颁布的《房产税暂行条例》,个人的非营业用房即居民的住房,()房产税。

A.免征

B.减半征收

C.全额征收

D.优惠征收

题型:问答题

根据《全国人民代表大会和地方各级人民代表大会代表法》的规定,出现下列哪些情形代表资格终止( )

A.辞职被接受的

B.未经批准两次不出席本级人大会议的

C.被罢免的

D.丧失行为能力的

题型:问答题

细胞分化时,细胞间的远距离相互作用是怎样实现的?

题型:问答题

简要回答教师应履行的基本职责。

更多题库