avg_1用了double型,怎么后面取平均值还是直接取得整数,没有小数。把sum_1换成double类型才出现小数,这是为什么?
sum_1=(i=i<i++){ System..println(+(i+)+)score_1=Scanner(System.).nextInt()sum_1+=score_1} avg_1avg_1=sum_1/System..println(+avg_1)
sum_1=(i=i<i++){ System..println(+(i+)+)score_1=Scanner(System.).nextInt()sum_1+=score_1} avg_1avg_1=sum_1/System..println(+avg_1)
2024-02-21
举报