C++ primer plus 第三章 编程练习 第三题程序样本

2018-08-06  本文已影响0人  今天恐怕幼稚不完

自己按照题意编的,已经跑通。

#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;

}

上一篇 下一篇

猜你喜欢

热点阅读