|
@@ -0,0 +1,28 @@
|
|
|
+/*
|
|
|
+ * To change this license header, choose License Headers in Project Properties.
|
|
|
+ * To change this template file, choose Tools | Templates
|
|
|
+ * and open the template in the editor.
|
|
|
+ */
|
|
|
+package javaapp1;
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @author Александр
|
|
|
+ */
|
|
|
+import java.io.*;
|
|
|
+import java.util.Scanner;
|
|
|
+
|
|
|
+class Average{
|
|
|
+public static void main(String args[]) throws IOException {
|
|
|
+ Scanner in = new Scanner(System.in);
|
|
|
+ int n;
|
|
|
+ double sum = 0.0;
|
|
|
+ double avg, t;
|
|
|
+ n = in.nextInt();
|
|
|
+ for(int i=0; i < n ; i++) {
|
|
|
+ t = in.nextDouble();
|
|
|
+ sum += t;
|
|
|
+ }
|
|
|
+ avg = sum / n;
|
|
|
+ }
|
|
|
+}
|