#include<iostream>
using namespace std;
const double pi=3.14;
class Circle
{
public:
area(int r)
{return (pi*r*r);}
private:
float radius;
};
int main()
{
int r;
Circle a;
cout<<"请输入圆的半径: ";
cin>>r;
cout<<"该圆的面积为: "<<a.area(r)<<endl;
return 0;
}
c++作业3.22
最新推荐文章于 2022-06-25 15:11:42 发布