温度转换-java

标签: java

考点:基本输入输出 

代码实现:

package temperature;

import java.util.Scanner;

public class temperature {

	public temperature() {
		// TODO Auto-generated constructor stub
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int f,c;
		Scanner in = new Scanner(System.in);
		f=in.nextInt();
		c=(int)((f-32)/(9/5.0));
		System.out.println(c);
		
	}

}

输出结果:

原文链接:加载失败,请重新获取