cpp_primer_plus/ch02/06.cpp

12 lines
282 B
C++
Raw Normal View History

2022-08-24 01:47:13 +08:00
# include <iostream>
using namespace std;
int main(){
double ly_value, au_value;
cout << "Enter the number of light years: ";
cin >> ly_value;
au_value = int(63240 * ly_value);
cout << ly_value << " light years = " << au_value << " astronomical unites" << endl;
return 0;
}