最新回答 / 慕少8494568
import java.util.Arrays;public class HelloWorld { //完成 main 方法 public static void main(String[] args) { int[] scores = {89,-23,64,91,119,52,73}; HelloWorld hw = new HelloWorld(); hw.sort3(scores); for(int ii= ...
2020-02-18
最赞回答 / 慕少8509374
?你这就直接打印了,至少要有点过程呀public class HelloWorld{ public static void main(String[] args) { int one = 10 ; int two = 20 ; int three = 0 ; three= one+two; System.out.println("three = one + two ==>"+ three); three += one...
2020-02-18
最新回答 / 起风了args
public class hollow //文件名没打对HelloWorld{public static void main(String[]args) {for(int i=1;i<=3;i++){for(int j=1;j<=i;j++); //多了个分隔号{System.out.println("*"); //*不用换行,它会跟随空格换行}System.out.println();}}}
2020-02-17
已采纳回答 / 逆光逆时针
因为你每次都是跟nums[0]比较,所以到最后20是小于nums[0]的,所以输出20为最小值。你的比较最大值那里,把nums[0]换成max。比较最小值那里,把nums[0]换成min,就可以了
2020-02-17
最赞回答 / In_Henry
这里涉及到 n++ 和 ++n 的区别:他们两个如果单独使用,就是一样的,自增一。你直接写 score++; 和 ++score; 都是对的但是如果要用赋值的方式,那么就涉及到他们两者的区别了,即:1. n = score++ 表示先赋值,再自增,n 的值为score自增前的值2. n = ++score 表示先自增,再赋值,n的值为score自增后的值你写的代码是情况一,但是你的n就是score本身,所以,你的score就前后冲突了。
2020-02-16