千克与磅之间的转换 Exercise05_05

时间:2023-12-29 20:48:14
 /**
* @author 冰樱梦
* 时间:2018年下半年
* 题目:千克与磅之间的转换
*
*/
public class Exercise05_05 {
public static void main(String[] args){
System.out.printf("%-27s %-25s %-27s %-10s\n","千克","磅","磅","千克");
int i=1,j=20;
// while(i<200 && j<=515){
// System.out.printf("%-10d %-8.1f %-10d %-10.2f\n", i,2.2*i,j,j/2.2);
// i+=2;
// j+=5;
// }
do{
System.out.printf("%-10d %-8.1f %-10d %-10.2f\n", i,2.2*i,j,j/2.2);
i+=2;
j+=5;
}while(i<200 && j<=515);
}
}