Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n = sc.nextInt();
- double sum = 0;
- for (double i = 0; i < n; i++) {
- Scanner scanner = new Scanner(System.in);
- double num = scanner.nextDouble();
- sum=sum+num;
- }
- double result = sum/n;
- System.out.printf("%.2f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement