亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Java程序 編譯時出現問題 結果如下圖 幫忙看看 謝謝

Java程序 編譯時出現問題 結果如下圖 幫忙看看 謝謝

Jessecheng 2016-04-11 17:47:43
import?java.util.*; public?class?Test7_4?{ public?static?void?main(String[]?args)?{ int[]?scores?=?new?int[scores.length]; Scanner?input?=?new?Scanner(System.in); System.out.print("Enter?scores:?"); for?(int?i?=?0;?i?<?scores.length;?i++)?{ //int?a?=?input.nextInt(); if?(input.nextInt()?>?100) continue; if?(input.nextInt()?<?0) break; scores[i]?=?input.nextInt(); } for?(int?i?=?0;?i?<?scores.length;?i++)?{ printCount(scores); } public?static?void?printCount(int[]?scores)? { if?(scores.length?==?0)? { System.out.println("No?argument?passed!"); return; } int?sum?=?0; for?(int?i?=?0;?i?<?scores.length;?i++)?{ sum?+=?scores[i]; } double?avg?=?sum?/?scores.length; int?countUp?=?0; int?countLow?=?0; for?(int?i?=?0;?i?<?scores.length;?i++)?{ System.out.println(scores[i]?+?"?"); if?(scores[i]?>=?avg) countUp++; else countLow++; } System.out.printf("The?avg?is?%3.1f\nUp?count?is?%2d\nLow?count?is?%2d\n",?avg,?countUp,?countLow); } }
查看完整描述

1 回答

已采納
?
guozhchun

TA貢獻103條經驗 獲得超76個贊

for?(int?i?=?0;?i?<?scores.length;?i++)?{
????????printCount(scores);

這里少打了一個'}',或者把 '{' 去掉

查看完整回答
反對 回復 2016-04-11
  • 1 回答
  • 0 關注
  • 1451 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號