public class Solution
 {
     public static void main(String[] args)
     {
         System.out.printf("%s\t%s\t%s\t%s\n", "Celsius", "Fahrenheit", "Fahrenheit", "Celsius");

         for(double i = 40, j = 120; i >= 31 && j >= 30; i--, j -= 10)
             System.out.printf("%.1f\t%.2f\t%.1f\t%.2f\n", i, celsiusToFahrenheit(i), j, fahrenheitToCelsius(j));
     }

     public static double celsiusToFahrenheit(double celsius)
     { return (9.0 / 5) * celsius + 32; }

     public static double fahrenheitToCelsius(double fahrenheit)
     { return (5.0 / 9) * (fahrenheit - 32); }
 }

HW5.8的更多相关文章

  1. HW5.36

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  2. HW5.35

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  3. HW5.34

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW5.33

    import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...

  5. HW5.32

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  6. HW5.31

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW5.30

    public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...

  8. HW5.29

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  9. HW5.28

    public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...

  10. HW5.27

    public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...

随机推荐

  1. Spring MVC常用的注解

    @Controller @Controller 负责注册一个bean 到spring 上下文中,bean 的ID 默认为 类名称开头字母小写,你也可以自己指定,如下 方法一: @Controller ...

  2. Docker容器中运行ASP.NET Core

    在Linux和Windows的Docker容器中运行ASP.NET Core 译者序:其实过去这周我都在研究这方面的内容,结果周末有事没有来得及总结为文章,Scott Hanselman就捷足先登了. ...

  3. I2C总线模拟(郭天祥视屏)

    电路图 思路 1.向EEPROM中通过I2C总线写入一个字节 2.通过I2C总线读出写入的字节 3.如果写入和读出成功点亮发光二极管 程序 #include <REGX51.H> #def ...

  4. throw 与 throws的应用

    throws---------->把异常交给调用处. 可以结合throw来同时使用. throws 用在方法声明处,表示本方法不处理异常.可以结合throw使用 throw 表示在方法中手工抛出 ...

  5. 如何使用 Java8 实现观察者模式?(下)

    [编者按]本文作者是 BAE 系统公司的软件工程师 Justin Albano.在本篇文章中,作者通过在 Java8 环境下实现观察者模式的实例,进一步介绍了什么是观察者模式.专业化及其命名规则,供大 ...

  6. idea快捷方式

    1. [常规] Ctrl + Shift + Enter,语句完成 "!",否定完成,输入表达式时按 "!"键 Ctrl + E,最近的文件 Ctrl+Shif ...

  7. !! python 之半年总结

    http://blog.chinaunix.net/uid-26443921-id-3481357.html 半年前开始系统完整深入的了解学习 python 读书篇: <python 核心编程2 ...

  8. noproguard.classes-with-local.dex

    make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-loca ...

  9. win2003+IIS6+PHP5.3.8+MSSQL2008的安装配置

  10. css揭秘之linear-gradient

    很神奇的背景设置, 看代码, <html> <title>css</title> <style> .content { background: line ...