C++ Primer Plus 6th 2.7 编程练习题 第6题 天文单位的转换
手机阅读 | 转发赚积分
手机收藏 | 分享给好友
手机阅读 | 转发赚积分
手机收藏 | 分享给好友
手机收藏 | 分享给好友
C++ Primer Plus编程练习题2.7第六题 天文单位的转换
#include <iostream>
using namespace std;
double lytoau(double ly)
{
return ly * 63240;
}
int main()
{
double ly;
cout << "Enter the number of light years: ";
cin >> ly;
double au = lytoau(ly);
cout << ly <<" light years = "<<au<<" astronomical units. "<<endl;
return 0;
}
当前文章为会员文章,请前往[用户中心]开通会员后继续阅读。