TÓPICO

Compilation Error JAVA

afcdlsantos perguntou 4 years ago

import java.text.DecimalFormat; import java.util.Scanner;

public class consumo1014 {

public static void main(String[] args) {

    Scanner in = new Scanner(System.in);

    int km = in.nextInt();

    float gas = in.nextFloat();

    in.close();

    double total;

    total = km / gas;

    DecimalFormat decimal = new DecimalFormat("0.###");

    String s = decimal.format(total);

    System.out.printf(s + " km/l\n");

}

}

Este tópico foi resolvido e não pode receber novas respostas.