我试图将米转换成英尺&英寸。米到英尺
踢的是让米正确拆分成英尺和英寸当然。
例如1.78应等于F 5年10
meters = 0.3048 * feet;
centimeters = 2.54 * inches;
or
const double METERS_PER_FOOT = 0.3048;
const double INCHES_PER_FOOT = 12.0;
我有骨架
cout << "How tall are you in meters? \n";
cin >> meters;
cout << "You're this tall in feet and inches F" << feet << " IN" << inches "\n";
我怎么就如何设置的公式来获取分开的右毫无头绪。
我不能使用cMath或我在其他示例中看到的这种转换。
如果你不能使用cMath,也许你可以使用数学呢? – 2014-10-16 22:26:38
将米转换为英寸,然后将英寸转换为英尺+英寸。你知道该怎么做,对吧? – clcto 2014-10-16 22:27:31
这是简单的数学计算,不需要'cMath'或任何“转换事物”。如果你是用铅笔和纸做的话,你会怎么做? – 2014-10-16 22:30:19