public class Length{
static double ratio = 2.45;
public static double transferCM(double cm){
double inch = cm / ratio;
return inch;
}
public static double transferINCH(double inch){
double cm = inch * ratio;
return cm;
}
public static void main(String[] args){
System.out.println("10厘米转成英寸的结果为:" + transferCM(10));
System.out.println("10英寸米转成厘米的结果为:" + transferINCH(10));
}
}