<pre class="cpp" name="code">#include <iostream>
using namespace std;
class Circle {
private:
double radius;
public:
double area(double rad);
};
double Circle::area(double rad)
{
cout<<"圆的面积是:"<<3.14*rad*rad<<endl;
return 3.14*rad*rad;
}
void main()
{
Circle C;
C.area(4);
}
}