标签:参数 turn const ios int using radius ace cout
#include <iostream>
using namespace std;
const double pi = 3.14159;
//double Area(double radius)
//{
// double result = 0;
// return result = pi * radius * radius;
//}
//
//int main()
//{
// double ra = 0;
// cin >> ra;
//
// double app = 0;
// app= Area(ra);
// cout << app << endl;
// return 0;
//}//---------------------------------------------------下面使用按引用传递参数
void Area(double radius, double& result)
{
result= pi * radius * radius;
}
int main()
{
double radius = 0;
cin >> radius;
double app = 0;
Area(radius, app);
cout << app << endl;
return 0;
}
标签:参数 turn const ios int using radius ace cout
原文地址:https://www.cnblogs.com/jyxy9899/p/14354009.html