输入华氏温度f,计算并输出相应的摄氏温度c。c=5*(f-50)/9+10.

import java.util.Scanner;
public class Main 
{
    public static void main(String[] args) 
    {
       Scanner reader=new Scanner(System.in);
       double f=reader.nextDouble();
       double c=5*(f-50)/9+10;
       System.out.print("The temprature is ");
       System.out.printf("%.2f",c);

    }
}

0

Leave a Reply

Your email address will not be published.