package pritice4;
public class Changekg {
public static void main(String[] args) {
// 打印千克和磅之间的转换
System.out.println("千克 磅 磅 千克 ");
int x = 1,z = 20;
double y = 2.2,k = 9.09;
for(;x<=199;)
{
System.out.print(x);System.out.print(" ");
System.out.printf("%.1f",y);System.out.print(" ");
System.out.print(z);System.out.print(" ");
System.out.printf("%.2f",k);System.out.print(" ");
x += 2;
y += 4.4;
z += 5;
k += 2.27;
System.out.println();
}
}
}
public class Changekg {
public static void main(String[] args) {
// 打印千克和磅之间的转换
System.out.println("千克 磅 磅 千克 ");
int x = 1,z = 20;
double y = 2.2,k = 9.09;
for(;x<=199;)
{
System.out.print(x);System.out.print(" ");
System.out.printf("%.1f",y);System.out.print(" ");
System.out.print(z);System.out.print(" ");
System.out.printf("%.2f",k);System.out.print(" ");
x += 2;
y += 4.4;
z += 5;
k += 2.27;
System.out.println();
}
}
}