liang183 发表于 2016-12-24 15:07:33

java编程题目:将摄氏温度转换为华氏温度

package nameyu;import java.util.Scanner;public class Test {    /**   * @param args   */    public static void main(String[] args) {      // TODO Auto-generated method stub      Scanner input=new Scanner(System.in);      System.out.print("Enter a degree in celsius:");      double Celsiustemperature=input.nextDouble();      double Fahrenheit=(9.0/5)*Celsiustemperature+32;      System.out.println(Celsiustemperature+"Cellsius is "+Fahrenheit+" Fahrenheit");    }}
页: [1]
查看完整版本: java编程题目:将摄氏温度转换为华氏温度