TOPIC

Runtime error! JAVA

Alan Lopes de Sousa Freitas asked 1 year ago

Alguém pode me explicar o porque do Runtime Error nesse código?

public static void main(String[] args){
        Scanner entrada = new Scanner(System.in);
            int n, i, j;
            String nome_jogador;
            double gd, nota;
            n = entrada.nextInt();
        while(n-- > 0){
            for(i=1; i<=n; i++)
            {
                double max = -10.00, min = 100.00, ans = 0.00;
                nome_jogador = entrada.next();
                gd = entrada.nextDouble();
                for(j=1; j<=7; j++)
                {
                    nota = entrada.nextDouble();
                    if(nota > max) max = nota;
                    if(nota < min) min = nota;
                    ans += nota;
                }
                ans -= (max+min);
                ans *= gd;
                System.out.printf("%s %.2f\n", nome_jogador, ans);
            }
        }
    }

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.