码迷,mamicode.com
首页 > 其他好文 > 详细

HW5.9

时间:2016-08-20 17:51:32      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

技术分享

 

 1 public class Solution
 2 {
 3     public static void main(String[] args)
 4     {
 5         System.out.printf("%s\t%s\t%s\t%s\n", "Inch", "Meter", "Meter", "Inch");
 6 
 7         for(double i = 1, j = 20; i <= 10 && j <= 65; i++, j += 5)
 8             System.out.printf("%f\t%f\t%f\t%f\n", i, footToMeter(i), j, meterToFoot(j));
 9     }
10 
11     public static double footToMeter(double foot)
12     { return foot / 0.305; }
13 
14     public static double meterToFoot(double meter)
15     { return meter * 0.305; }
16 }

 

HW5.9

标签:

原文地址:http://www.cnblogs.com/wood-python/p/5790814.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!