自己按照题意编的,已经跑通。
#include <iostream>
int main()
{
using namespace std;
double du, fen, miao;
double latitude;
const int change = 60;
cout << "Enter a latitiude in degrees,minutes, and seconds: "<< endl;
cout << "First enter the degrees: ";
cin >> du;
cout << "Next, enter the minutes of arc: ";
cin >> fen;
cout << "Finally, enter the seconds of arc: ";
cin >> miao;
latitude = du + fen / change + miao / change / change ;
cout << du << " degrees, " << fen << " minutes, " << miao << " seconds = " << latitude << " degrees. " << endl;
cin.get();
cin.get();
return 0;
}
网友评论