温度转换(5分)

package com.mayic.temperature;

import java.util.Scanner;

public class Temperature {

      public static void main(String[] args) {
            // TODO 自动生成的方法存根
            System.out.println("华氏度-摄氏度");
            Scanner in = new Scanner(System.in);
            System.out.print("请输入华氏温度:");
            double F;
            double C;
            F = in.nextDouble();
            C = ( F - 32 ) / ( 9 / 5.0 );
            System.out.print("摄氏温度是:");
            System.out.println((int)C);

      }

}

posted @ 2017-02-10 16:07  mayic  阅读(178)  评论(0)    收藏  举报