#include<iostream>
using namespace std;
class Circle
{
public:
Circle(double r)
{
radius=r;
}
double area()
{
return (3.14*radius*radius);
}
private:
double radius;
};
int main()
{
Circle c1(1.00);
cout<<"圆的面积为:"<<c1.area();
cout<<endl;
return 0;
}
using namespace std;
class Circle
{
public:
Circle(double r)
{
radius=r;
}
double area()
{
return (3.14*radius*radius);
}
private:
double radius;
};
int main()
{
Circle c1(1.00);
cout<<"圆的面积为:"<<c1.area();
cout<<endl;
return 0;
}