思路:
输入一个华氏温度,根据公式转化成摄氏温度即可
代码:
public class Demo1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请华氏温度:");
int huashi = sc.nextInt();
float c= (float)(huashi-32)*5/9;
System.out.println(""+c);
}
}
运行结果: