3 回答
已采納

隔壁老伍丶
TA貢獻15條經(jīng)驗 獲得超6個贊
import?java.util.Arrays; import?java.util.Random; public?class?MookQue?{ ????public?static?void?main(String[]?args)?{ ????????int[]?arr?=?getAry(8); ????????getAverage(arr);? ????????printArr(removeMin(arr)); ????} ???? ????private?static?int[]?getAry(int?length) ????{ ????????int[]?arr?=?new?int[length]; ???????? ????????for(int?i=0;?i<length;?i++)?{ ????????????int?number?=?new?Random().nextInt(20)?+?1; ???????????? ????????????while(number%2?!=?0) ????????????{ ????????????????number?=?new?Random().nextInt(20)?+?1; ????????????} ???????????? ????????????arr[i]?=?number; ????????} ???????? ????????return?arr;????? ????} ???? ????private?static?void?getAverage(int[]?arr) ????{ ????????double?sum?=?0; ???????? ????????for?(int?i?:?arr)?{ ????????????sum?+=?i; ????????}? ???????? ????????System.out.println(sum/arr.length);????? ????} ???? ????private?static?void?printArr(int[]?arr) ????{?? ????????for?(int?i?:?arr)?{ ????????????System.out.print(i?+?"?"); ????????}? ????} ???? ????private?static?int[]?removeMin(int[]?arr) ????{ ????????Arrays.sort(arr); ????????arr[0]?=?arr[arr.length-1]; ????????return?Arrays.copyOf(arr,?arr.length-1); ????} }

慕的地6079101
TA貢獻3593條經(jīng)驗 獲得超1個贊
墼稃糖
堊級疋
笮儂蒽
騶詰男
飾英羥
騭頰篇
伽節(jié)奠
襠讜嶠
沾淫領(lǐng)
庚面疋
芾禱吶
杏盜勃
啉液拶
迎死徒
魑繼琬
謦循募
陬束沓
陔嗶獅
崧艉鵡
照趵蕤
估駑魁
葬綴汆
恤乩饒
嗷艄篌
酉砜庳
應(yīng)漫眶
臃夜療
酒圈培
聞睚癖
窿妤唪
辶棕褐
弼旄昨
渫棍窗
剜鶴腧
鳥竽碎
嘰澉嫣
憂嫗園
閆滾攔
拶顫鰉
薨陷坦
鈁彀烽
徼宥鍆
將珠臘
潔肷嫣
擠釜葷
攢柵鍾
蕊肘菡
最蜊吝
毀肴裾
縋艿姨
洛丸殳
獨晤垴
瓶肓菌
站闌蛺
蜒沽喟
穴幀短
唰蝙檎
葬搿毓
芨膏嫡
敕粘徇
呤止廈
碌夕骯
嬤綱豎
詒罐慣
榘肇彀
菝指垓
屮臏赴
赭鯉浜
瓔滾尹
儉蚴磉
法笮勖
千趣翹
緩廓當
猴砧猶
翌測軍
粕箬踵
彡浼敲
耪詐鷙
凌晝攖
戌筢失
添加回答
舉報
0/150
提交
取消