美文网首页
C++ primer plus 第三章 编程练习 第三题程序样本

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

作者: 今天恐怕幼稚不完 | 来源:发表于2018-08-06 19:50 被阅读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;

}

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/koagvftx.html