TOPIC

Por que está aparecendo Runtime Error?

Ronaldo Melo asked 1 year ago

As sáidas foram testadas e estão de acordo com o Udebug mas ao submeter retorna um runtime error. Porque?

import java.util.Locale; import java.util.Scanner;

public class Main {

public static void main(String[] args) {

    Locale.setDefault(Locale.US);
    Scanner sc = new Scanner(System.in);

    String out;

    float a = 0;
    float b = 0;

    double c = 0;
    double d = 0;

    String lineSP = sc.nextLine();
    String lineDP = sc.nextLine();
    String aux[];

    while (!(lineSP.isEmpty() || lineDP.isEmpty())) {

        aux = lineSP.split(" ");

        a = Float.parseFloat(aux[0]);

        b = Float.parseFloat(aux[01]);

        aux = null;
        aux = lineDP.split(" ");

        c = Double.parseDouble(aux[0]);

        d = Double.parseDouble(aux[1]);

        System.out.printf("A = %f, B = %f\n", a, b);

        System.out.printf("C = %f, D = %f\n", c, d);

        System.out.printf("A = %.1f, B = %.1f\n", a, b);

        System.out.printf("C = %.1f, D = %.1f\n", c, d);

        System.out.printf("A = %.2f, B = %.2f\n", a, b);

        System.out.printf("C = %.2f, D = %.2f\n", c, d);

        System.out.printf("A = %.3f, B = %.3f\n", a, b);

        System.out.printf("C = %.3f, D = %.3f\n", c, d);

        System.out.printf("A = %.3E, B = %.3E\n", a, b);

        System.out.printf("C = %.3E, D = %.3E\n", c, d);

        String saida17 = String.format("A = %.0f, B = %.0f", a, b);
        System.out.println(saida17);

        out = String.format("C = %.0f, D = %.0f", c, d);
        System.out.println(out);

        lineSP = sc.nextLine();
        lineDP = sc.nextLine();

    }

    sc.close();
}

}

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

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