1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 final double POUNDS_PER_KILOGRAM = 2.2; 6 7 System.out.println("Kilograms" + "\t" + "Pounds" + "\t" + "Pounds" + "\t" + "Kilograms"); 8 9 for(int i = 1, j = 20; i < 200 && j <= 515; i += 2, j += 5) 10 System.out.println(i + "\t" + i * POUNDS_PER_KILOGRAM + "\t" + j + "\t" + j * 1.0 / POUNDS_PER_KILOGRAM); 11 } 12 }
时间: 2024-11-02 01:33:09