用于对变量的理解
float强制类型转化,两个变量其中一个就可以得到float的效果
但是如果是这样
实现的就是float无效。
#includeusing namespace std; const int DEGREE_TO_MINUTE = 60; const int MINUTE_TO_SECOND = 60; int main() { int degree, minute, second; float degree_style; cout<<"Enter a latitude in degrees, minutes, and seconds:"< >degree; cout<<"Next, enter the minutes of arc:"; cin>>minute; cout<<"Finally, enter the seconds of arc:"; cin>>second; degree_style = degree + minute / float(DEGREE_TO_MINUTE) + second/float(MINUTE_TO_SECOND * DEGREE_TO_MINUTE); // degree_style = degree + float(minute) / DEGREE_TO_MINUTE + // float(second)/(MINUTE_TO_SECOND * DEGREE_TO_MINUTE); cout<



