9-6.cpp
来自「能理解C++中运算符重载的需要性」· C++ 代码 · 共 27 行
CPP
27 行
#include <iostream.h>
float temp;
float fn1(float r)
{
temp=r*r*3.14;
return temp;
}
float& fn2(float r)
{
temp=r*r*3.14;
return temp;
}
void main()
{
float a=fn1(5.0);
float c=fn2(5.0);
float& d=fn2(5.0);
cout<<a<<endl;
cout<<c<<endl;
cout<<d<<endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?