import java.util.Scanner; public class AverageInput { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("è«è¼¸å ¥å¸ç人æ¸: "); int length = scanner.nextInt(); float[] score = new float[length]; // åæ é ç½®é·åº¦ for(int i = 0; i < score.length; i++) { System.out.print("è¼¸å ¥åæ¸ï¼"); float input = scanner.nextFloat(); score[i] = input; } System.out.print("\n忏ï¼"); float total = 0; for(int i = 0; i < score.length; i++) { total = total + score[i]; System.out.print(score[i] + " "); } System.out.printf("\nå¹³åï¼%.2f", total / score.length); } }