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

HW2.4

时间:2016-08-06 14:18:00      阅读:180      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 1 import java.util.Scanner;
 2 
 3 public class Solution
 4 {
 5     public static void main(String[] args)
 6     {
 7         final double POUND_TO_KILOGRAM = 0.454;
 8 
 9         Scanner input = new Scanner(System.in);
10 
11         System.out.print("Enter a number in pounds: ");
12         double pounds = input.nextDouble();
13         double kilogram = pounds * POUND_TO_KILOGRAM;
14 
15         System.out.println(pounds + " pounds is " + kilogram + " kilograms");
16 
17         input.close();
18     }
19 }

 

HW2.4

标签:

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

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