Q:

Print double with two decimal problem in java

I have problem with similar task.
Here is the task:

The sample tests are:
This is my code:
import java.text.DecimalFormat;
import java.util.Scanner;
public class MinMaxSumAverage {
    public static void main(String[] args) {
        DecimalFormat df = new DecimalFormat("#0.00");
        Scanner scanner = new Scanner(System.in);
        double average;
        double sum = 0;
        double max = Integer.MIN_VALUE;
        double min = Integer.MAX_VALUE;
        double numbers = scanner.nextInt();

        for (int i = 0; i < numbers; ++i) {
           int num = scanner.nextInt();
            if (num > max) max = num;
            if (num < min) min = num;
            sum += num;
        }
        average = sum / numbers;
        System.out.println("min=" + (df.format(min)));
        System.out.println("max=" + (df.format(max)));
        System.out.println("sum=" + (df.format(sum)));
        System.out.println("avg=" + (df.format(average)));
    }
}

It work correct, but in "judge system" who test my code have some errors:
Can you help me to find what's wrong with my code?
Edit:
I change sum, max & min from double to int, and test result have minimal changes:
Test 2:

A:

Your code is failing to accept decimal inputs that's why you are receiving InputMismatchException. Change this line 
int num = scanner.nextInt();

to 
double num = scanner.nextDouble();

