fork download
  1. import java.util.*;
  2. class Main {
  3. public static void main(String[] args) {
  4. Scanner scanner = new Scanner(System.in);
  5. System.out.println("Por favor indique um valor minimo:");
  6. float min = scanner.nextFloat();
  7. System.out.println("Agora indique um valor máximo:");
  8. float max = scanner.nextFloat();
  9. System.out.printf("Fahrenheit Celsius\n");
  10. for (float i = min; i <= max; i += .5) {
  11. System.out.printf("%6.2f %6.2f%n", i, ((i - 32.0) * ( 5.0 / 9.0)));
  12. }
  13. }
  14. }
  15.  
  16. //https://pt.stackoverflow.com/q/250434/101
Success #stdin #stdout 0.12s 37164KB
stdin
30
35
stdout
Por favor indique um valor minimo:
Agora indique um valor máximo:
Fahrenheit Celsius
 30.00      -1.11
 30.50      -0.83
 31.00      -0.56
 31.50      -0.28
 32.00       0.00
 32.50       0.28
 33.00       0.56
 33.50       0.83
 34.00       1.11
 34.50       1.39
 35.00       1.67