#include <iostream>
#include<cstring>
#define PI 3.1415926
using namespace std;
class Circle
{
private:
int radius;
public:
double area()
{
return (radius*radius*PI);
}
Circle(int i)
{
radius=i;
}
};
int main()
{
Circle yuan1(3);
double n=yuan1.area();
cout<<"The area is:"<<n<<endl;
return 0;
}
作业3.22
最新推荐文章于 2024-03-24 21:35:17 发布