HW5.8

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的更多相关文章
- HW5.36
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.35
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.34
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.33
import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...
- HW5.32
public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...
- HW5.31
import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...
- HW5.30
public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...
- HW5.29
public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...
- HW5.28
public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...
- HW5.27
public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...
随机推荐
- CSS3 关于@font-face引用中文字体解决办法
有两种方法,一种简单的,一种比较复杂,都可以实现(注:这里的方法只适合使用少量的中文字体,如果使用的字量过大,请使用其他方法解决) 第一种:简单的 1.下载需要的中文字体的.ttf格式,这个都不难找到 ...
- myeclipse10.0优化
一.Myeclipse10修改字体 MyEclipse10是基于Eclipse3.7内核,但在Eclipse的Preferences-〉general-〉 Appearance->Colors ...
- 【filter】springmvc web.xml
1.filter用于拦截用户请求,在服务器作出响应前,可以在拦截后修改request和response,这样实现很多开发者想得到的功能. 2.filter实现 ×编写一个继承Filter接口的类 ×在 ...
- Boost IPC Persistence Of Interprocess Mechanisms 例子
下面这一段摘抄自 Boost 1_55_0 的文档,显然标注了 每一个的生命期. One of the biggest issues with interprocess communication m ...
- Mysql不区分大小写
mysql在windows下表名是不区分大小写的,但是在linux下是区分大小写的: 今天帮朋友解决安装到ubuntu系统下mysql不区分大小写的问题,最初在/etc/my.cnf文件中的[mysq ...
- 异常: http://www.ly.com/news/visa.html: java.io.IOException: unzipBestEffort returned null
nutch 运行时异常: http://www.ly.com/news/visa.html: java.io.IOException: unzipBestEffort returned null 参考 ...
- AForm — 模型驱动的自动化表单解决方案
http://xiehuiqi220.github.io/AForm/doc/book/#
- 关于Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean
在一个业务类有下列属性 private SchedulerFactoryBeanscheduler; public SchedulerFactory BeangetScheduler() { retu ...
- java区分大小写,使用TAB进行缩进,public类名只能有一个,而且文件名与类名保持一致.
java的类必须大写 java区分大小写,使用TAB进行缩进,public类名只能有一个,而且文件名与类名保持一致. 在dos用上下箭头,调用已用过的命令
- SPRING IN ACTION 第4版笔记-第五章BUILDING SPRING WEB APPLICATIONS-005-以path parameters的形式给action传参数(value=“{}”、@PathVariable)
一 1.以path parameters的形式给action传参数 @Test public void testSpittle() throws Exception { Spittle expecte ...