已采纳回答 / _jq
a++或++a,这两个在最后的结果a都是自增的不同的是:int b=++a; // a先自增再赋值给bint b=a++; // a先赋值给b,a再自增结果都是a是要自增
2018-01-03
最新回答 / x乌鸦坐飞机
float是单精度,double是双精度。float在内存中占4个字节,double占8个字节,能表示的小数长度也不一样。类似整数byte.short.int.long的区别。
2018-01-02
已采纳回答 / Pluto_zzh
你的这段代码主要有三个问题:1:for循环的条件不对for(int i = (scores.length - 1); i>=0; i++) 开始条件和终止条件都不对,开始条件,你的意思是i = (scores.length - 1)也就是数组长度-1,从数组的最后一个开始,然后每一次判断 i++,然后判断 i>=0,明显这个判断条件必然成立,i++后会导致数组索引错误。所以for循环有问题。改进:从第一个开始,最后一个结束for(int i = 0; i<scores.length; ...
2017-12-29
最赞回答 / 咸鱼翻身_
public class nianLing { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("请输入您的年龄"); int age=input.nextInt(); if (age>=60){System.out.println("老年");} else if(age>40) { System.out.println("中年"...
2017-12-29