用java将千克转换为磅(1千克为2.2磅)答案如下
package nameyu;public class Test { /** * @param args */ public static void main(String[] args) { int kilogram=1; System.out.printf("%-5s%-5s%n", "千克","磅 "); for(kilogram=1;(kilogram<=200);kilogram=kilogram+2){ double pound=kilogram*2.2; System.out.printf("%-5d%-2.1f%n",kilogram,pound); } }}
页:
[1]