import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); double number = input.nextDouble(); //转换公式在这里转化的时候需要注意9应该边城9.0不然结果会不对 double fahrenheit = (9.0/5)*number + 32; System.out.println(number+"转化为"+fahrenheit); } }
时间: 2024-10-06 16:35:39