已采纳回答 / 空城碎忆丶
因为你的score变量加的是count变量,而count变量每次循环加1,所以你的程序实际的运行过程是:第一次循环:score = 53 + 0 = 53; count = 0 + 1 = 1;第二次循环:score = 53 + 1 = 54; count = 1 + 1 = 2;第三次循环:score = 54 + 2 = 56; count = 2 + 1 = 3;第四次循环:score = 56 + 3 = 59; count = 3 + 1 = 4;第五次循环:score...
2018-09-21
已采纳回答 / 慕移动8525203
package cn.sc.as;public class Conus { double PI=3.14; double r; double high; double volume; public double getR() { return r; } public void setR(double r) { this.r = r; } public double getHigh() { return high; } public void setHigh(double high) { this....
2018-09-21
已采纳回答 / 慕勒2701546
Arrays.sort(cheng);
int count = 0;
for(int i=cheng.length-1;i>=0;i--){
if((cheng[i]<100&&cheng[i]>0)){
count++;
System.out.println(cheng[i]);
if(count==3){
break;
}
}
}
2018-09-20
最新回答 / pingfrog
因为这个是针对方法里的数组scores进行排序的一个Arrays的静态方法;在方法内给这个数组排序才不会出现顺序错乱的现象,如果你放这个引用方法的外面就莫得数组给你初始化排序了0.0
2018-09-20
已采纳回答 / Moonlightsa
那块没有问题的,if 是条件语句,只有小括号里的表达式为true ,才会执行大括号里的代码。如果第一个数已经比第二个数大了,就不会执行if代码了,因为那个的目的就是交换值
2018-09-19