C++primer plus第六版课后编程练习答案3.3

来源:互联网 发布:网络运营者应当为 编辑:程序博客网 时间:2024/05/05 17:23
#include <iostream.h>    const int DToM=60;  const int MToS=60;    int main()  {   <span style="white-space:pre"></span>cout<<"Enter a latitude in degrees,Minute,an seconds:"<<endl;  <span style="white-space:pre"></span>cout<<"First,enter the degreess:";  <span style="white-space:pre"></span>float d;  <span style="white-space:pre"></span>cin>>d;  <span style="white-space:pre"></span>cout<<"Next,enter the minutes of arc:";  <span style="white-space:pre"></span>float m;  <span style="white-space:pre"></span>cin>>m;  <span style="white-space:pre"></span>cout<<"Finally,enter the seconds of arc:";  <span style="white-space:pre"></span>float s;  <span style="white-space:pre"></span>cin>>s;  <span style="white-space:pre"></span>cout<<d<<" degreess ,"<<m<<" minutes, "<<s<<" seconds"  <span style="white-space:pre"></span><<"="<<((m/DToM)+(s/MToS/DToM)+d)<<" degress"<<endl;      cin.get();      cin.get();      return 0;  }   

0 0