3.3

#include<iostream>

int main()
{
	using namespace std;
	
	const int Degree_to_minute = 60;//1度=60分
	const int Minute_to_second = 60;//1分=60秒

	int degree, minute, second;

	cout << "Enter a latitude in degrees,minutes,and seconds:\n";
	cout << "First,enter the degrees: ";
	cin >> degree;
	cout << "Next,enter the minutes of arc: ";
	cin >> minute;
	cout << "Finally,enter the seconds of arc: ";
	cin >> second;
	double degrees = ((double(second) / Minute_to_second + minute) / double(Degree_to_minute)) + degree;
	cout << degree << " degrees, " << minute << " minutes, " << second << " seconds = " << degrees<<" degrees"<<endl;
	
	return 0;
}

你可能感兴趣的:(C++)