您的位置:首页 > 编程语言 > C语言/C++

c++之函数的调用

2016-04-05 17:27 232 查看
#include<iostream>

#include<math.h>

using namespace std;

void output(double light_year,double astronomical_units);

int main()

{
double light_year;
double astronomical_units;
cout<<"Enter the number of light years  : ";
cin>>light_year;
output(light_year,astronomical_units);//函数的调用必须见参数填入,可以不填参数类型,否则报错 
cout<<light_year<<" light years = "<<astronomical_units<<" astronomical units "<<endl;

}

void output(double light_year,double astronomical_units) 

{

    astronomical_units=light_year*63240;

    

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  c++ 函数