1.16
package lianxi; import java.util.Scanner; public class WenDu { public double getHuaSD(double sheSD) { double huaSD = 1.8 * sheSD + 32; return huaSD; } public static void main(String[] args){ System.out.println("请输入要转换的温度(单位:摄氏度):"); Scanner ssd =new Scanner(System.in); double shesd =ssd.nextDouble(); WenDu zhh = new WenDu(); double huaSD =zhh.getHuaSD(shesd); System.out.println("转换完成的温度(单位:华氏度):" + huaSD); } }