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 }
时间: 2024-11-09 03:20:07