我不知道如何获得英寸,它只适用于脚而不是英寸
这是应该将米转换为英尺到英寸的代码部分
输出示例应为:
输入米数作为双精度数:15
15.00 米的值是 49 英尺和2.55英寸。
//
//METERS_PER_FOOT=0.3048
//INCHES_PER_FOOT=12.0
//makes conversion from metric to English units
void convert(int& feet, double& inches, double meters)
{
feet=meters/METERS_PER_FOOT;
inches=feet/INCHES_PER_FOOT; //this line should give me inches
}